Saturday, December 10, 2011

Debian: Add user to group

After doing a fresh install of Debian 'testing' (wheezy/sid), I needed to make it so my regular user could do 'sudo this-or-that'. Although a user account is created during the Debian installation process, this user is not included in the /etc/sudoers file by default.

I used to add a line to the /etc/sudoers file directly, using the 'visudo' command. However, I noticed that, as of Debian 6.0 "squeeze", the system is set up so that all users in the 'sudo' group have full access to sudo.

So, the problem arose - how to add a user to the 'sudo' group? For years, I used to add users to groups by simply editing /etc/group. Nowadays, "there's an app for that." OK, it's not quite an app, but the following command (or incantation, if you will) should add user "fuser" to the group "groupie":
# usermod -a -G groupie fuser

For more information, see "man usermod".

No comments:

Post a Comment