visudo

#give xing  certain privilege to be a account manager
visudo
User_alias ADMINS = xing

Cmnd_alias MINIMUM = /usr/sbin/useradd /usr/sbin/userdel /usr/bin/passwd,/usr/sbin/groupadd /usr/sbin/groupdel

ADMINS ALL=MINIMUM

#allow xing to run sudo on loclhost (client) only
xing  client=/usr/sbin/useradd, /usr/sbin/userdel

#add xing to /etc/group wheel group to get root

login as xing
$ sudo useradd lian
$ sudo userdel lian
can do what ever as root , need sudo in front of the command.






你可能感兴趣的:(职场,休闲)