User Tools

Site Tools


linux:sudo

This is an old revision of the document!


sudo howto

Use visudo command to update the file /etc/sudoers, do not manual edit

Which password will be asked ? default is target user password, and for group wheel, source user password:

Defaults targetpw
Defaults:%wheel !targetpw

In the following sudo entry:

<user> <host>=(<taget_user>[:<target_group>]) <cmd>

Example:

alan   ALL = (root, bin : operator, system) /bin/ls, /bin/kill
%adm ALL=(ALL) NOPASSWD: ALL

Here, alan is allowed to run the two commands /bin/ls and /bin/kill as root (or bin), possibly with additional operator or system groups privileges.

So alan may choose to run ls as the bin user and with operator's group privileges like this (additional operator groups privileges):

# sudo -u bin -g operator /bin/ls /whatever/directory
linux/sudo.1609532710.txt.gz · Last modified: 2021/01/01 21:25 by 127.0.0.1