View previous topic :: View next topic |
Author |
Message |
Johnyp Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/2147073005426086edac886.gif)
Joined: 23 Mar 2005 Posts: 301
|
Posted: Thu Jun 23, 2005 2:28 am Post subject: Change GID for a user |
|
|
Hey all
How can i change GID for a user?
I've tried usermod -G foo bar , where foo is a gruop who's id i want to assign to the user bar, but that just adds the user bar to group foo.
And another question - how can i find out GID for a particular group?
thank you _________________ Gentoo Unanswered Questions- Give it a try! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Kaboosh Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/144638519740c7dd8ba818c.png)
Joined: 10 Jun 2004 Posts: 162 Location: Edmonton, AB - Canada
|
Posted: Thu Jun 23, 2005 2:36 am Post subject: groupmod |
|
|
Do a groupmod -g [NEW_GID] [GROUP_NAME]
This is required because users don't have GID's - they have groups which have the same name as their usernames (a RedHat invention).
Note: Any files with permissions assigned to that group number will retain the old group number - permissions must be reassigned manually!
You can reassign these permissions en-masse using find / -group [OLD_GROUP_GID] -exec chgrp [NEW_GROUP_NAME] \; as root
Last edited by Kaboosh on Mon Jun 27, 2005 9:21 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Johnyp Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/2147073005426086edac886.gif)
Joined: 23 Mar 2005 Posts: 301
|
Posted: Thu Jun 23, 2005 3:21 am Post subject: |
|
|
Thanks for the answer, but i'm still confused....
Quote: | groupmod -g [NEW_GID] [NEW_GROUP_NAME] |
That would change the name of the group from one to another? (looked in the man file, but it didn't make any more clear).
Lets say i have a user vmail with the following output from the #id vmail command
uid=1001(vmail) gid=100(users) groups=100(users),1001(vmail)
I want the gid ^ to be changed to vmail, not users. What would be the command to do this?
Thanks ! _________________ Gentoo Unanswered Questions- Give it a try! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Jun 23, 2005 3:38 am Post subject: |
|
|
usermod -g 1001 vmail
That should take care of you assuming the vmail group already exists.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Johnyp Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/2147073005426086edac886.gif)
Joined: 23 Mar 2005 Posts: 301
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|