Groups on the Linux Command Line

March 9, 2010

Something I always forget how to do is create a new group on the command line and then add users to it. It is important to get these commands right as a missed option can really screw up the permissions for your user!

To create a new group called subversion:

sudo groupadd subversion

To add user foo to this group do:

usermod -a -G subversion foo

Missing the -a from the last command means foo will ONLY be a member of the subversion group, all other group associations are dropped.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: