Tuesday, 4 August 2009

A new sudoers structure

If I keep sudo-based root access, the sudo structure will change as follows

1) The group wheel will be added by the Skinny install process.

2) The install process will also add

%wheel  ALL=(ALL)   ALL

to the sudoers file.

3) Then, making a user an superuser/admin simply involves adding the user to the wheel group (which the install process should also do for the installing user).

After the single addition to the sudoers file, no messing with the file is needed! Even better, removing someones admin status is as easy as removing them from the wheel group. Why wheel? I don’t know, but it seems to be the classic group to use for these purposes.

So, the relevant commands…

To add a group to the system:

groupadd <groupname>

To add a user to a group:

gpasswd -a <username> <groupname>


usermod -a -G <groupname> <username>

To delete a user from a group:

gpasswd -d <username> <groupname>

This is so much better than the sudoers hacks that were part of the original setup.