- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Making user member of more than one group
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 09:04 AM
тАО12-30-2008 09:04 AM
I have X user member of group a. Now I want to modify it and make the user x member of group a and b. How can I do that.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 09:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 09:10 AM
тАО12-30-2008 09:10 AM
Re: Making user member of more than one group
useradd -G b X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 09:18 AM
тАО12-30-2008 09:18 AM
Re: Making user member of more than one group
If I want to change the uid and gid of existing user and group, how can I achieve that.
As we have copied some data from old server and now running those data on this new hpux server. So the data is having the uid and gid of old server while in new server uid and gid is different than old server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 09:31 AM
тАО12-30-2008 09:31 AM
Re: Making user member of more than one group
You have a problem. If you really really want to do that, you'll need to find all of the files owned by that user and change to the new UID. Also the same for GID.
>So the data is having the uid and gid of old server while in new server uid and gid is different than old server.
It would have been better to reuse the same UID/GID. But if you have to change, you can use find(1) to find and change them:
find file-system ... -user old-uid -exec chown uid {} +
find file-system ... -group old-gid -exec chgrp gid {} +
(The above two searches are in case not all files have both old-uid old-gid.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 10:31 AM
тАО12-30-2008 10:31 AM
Re: Making user member of more than one group
Now the user is having uid 102 and group x as 200. So if I want to change the user uid to 109 and group to 201 then how can I achive?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 03:32 PM
тАО12-30-2008 03:32 PM
Re: Making user member of more than one group
usermod -u
Example: "usermod -u 109 user"
To change the GID of an existing group:
groupmod -g
Example "groupmod -g 201 x"
If the user/group had created any files/directories on the system before the change, you must then run the find commands described by Dennis, otherwise the file ownerships won't be properly recognized. The files will be listed as belonging to an unnamed user/group (the "ll" command will display the old UID/GID numbers instead of user/group names) and the files and directories can be accessed only by root, unless the permissions are set to world-readable.
Example: when running something like "ll userfile", you will see:
-rw-r--r-- 1 102 200 ...
instead of:
-rw-r--r-- 1 user x ...
Dennis's find commands will fix this.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 03:59 PM
тАО12-30-2008 03:59 PM
Re: Making user member of more than one group
Yes basically you did. Changing the IDs would require changing the files. Either you change the IDs on the old server as MK said, then use find(1) to fix them before moving to the new server. Or move them to the new server and use find to fix them there.
Basically UNIX keeps track of IDs and not names. Changing /etc/passwd & /etc/group mappings would require changing all of the files with those old IDs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 04:45 PM
тАО12-30-2008 04:45 PM