Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding a user to a group 1

Status
Not open for further replies.

delfy

MIS
Feb 8, 2005
96
JM
i already added a user using useradd myuser

but i need to add this user to a particular group mygroup
how would i do this at the commandline?
 
groupadd mygroup (if necessary)
usermod -G mygroup myuser

In the case the user already belongs to 'thisgroup' and 'thatgroup' and you wish to retain those relationships...


usermod -G mygroup,thisgroup,thatgroup myuser

D.E.R. Management - IT Project Management Consulting
 
Does anyone else wish usermod had a syntax to retain existing groups? Something like usermod -G +newgroup username would seem sensible to me.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top