Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Change GID for a user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Johnyp
Guru
Guru


Joined: 23 Mar 2005
Posts: 301

PostPosted: Thu Jun 23, 2005 2:28 am    Post subject: Change GID for a user Reply with quote

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
View user's profile Send private message
Kaboosh
Apprentice
Apprentice


Joined: 10 Jun 2004
Posts: 162
Location: Edmonton, AB - Canada

PostPosted: Thu Jun 23, 2005 2:36 am    Post subject: groupmod Reply with quote

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
View user's profile Send private message
Johnyp
Guru
Guru


Joined: 23 Mar 2005
Posts: 301

PostPosted: Thu Jun 23, 2005 3:21 am    Post subject: Reply with quote

Thanks for the answer, but i'm still confused....:oops:

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
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Thu Jun 23, 2005 3:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Johnyp
Guru
Guru


Joined: 23 Mar 2005
Posts: 301

PostPosted: Thu Jun 23, 2005 3:59 am    Post subject: Reply with quote

Ahhh... got it!

Thank both of you guys!
_________________
Gentoo Unanswered Questions- Give it a try!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum