Tony Narlock Living life in the cloud

17Mar/100

Add your user groups to sudoers file

sudo allows system administrators to delegate authority to other users on a server. In this post, we will show how user groups can sudo.

Sudo (su "do") allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while providing an audit trail of the commands and their arguments.

Some users mistakenly attempt to add themselves to the /etc/sudoers file directly. This doesn't work. Use the command visudo.

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

You can have add a user called penguin to users: useradd -G users penguin

Then, you can add penguin to the admin admin group. usermod -a -G admin penguin

Now penguin can sudo.

You can also give users ability to sudo without a password (for cron-type stuff).

Type visudo in terminal.

Uncomment # %sudo ALL=NOPASSWD: ALL by removing the #, or add %sudo ALL=NOPASSWD: ALL

Now add penguin to sudo group.

usermod -a -G sudo penguin

For more information on sudo, you can see the manual pages at man sudo.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.