User Tools

Site Tools


myhelp:sudo
SUDO Example:
## Lock other Users
#user1 ALL = NOPASSWD: /usr/bin/passwd -[lu] user2, (root) /usr/bin/passwd -[lu] user3, (root) /usr/bin/passwd -[lu] user4, (root) /usr/bin/passwd -[lu] user5
Do not allow specific commands to users

Example /etc/sudoers

...

## Command Aliases
## These are groups of related commands...
Cmnd_Alias SHELLS = /bin/sh, /bin/csh, /bin/ksh, /bin/bash, /bin/tcsh, /bin/zsh
Cmnd_Alias SUDOSECURITY = /bin/su, /bin/passwd, /sbin/userdel, /sbin/useradd, /bin/chattr, /sbin/visudo, /bin/vi, /bin/sudoedit /etc/sudoers, sudoedit /etc/sudoers*, /bin/sudoedit /etc/sudoers.d/*, sudoedit /etc/sudoers.d/*

...

And place a file in /etc/sudoers.d. For example /etc/sudoers.d/myuser

myuser ALL=NOPASSWD: ALL, !SUDOSECURITY, !SHELLS

myuser can do everthing except the commands listed under SHELLS and SUDOSECURITY.

sudo and forward X

After using the sudo-command to switch to another user, you have to merge the X-session:

xauth merge /home/user/.Xauthority 
myhelp/sudo.txt · Last modified: by 127.0.0.1