Difference between revisions of "Understanding sudo configuration syntax"

From Notes_Wiki
m
m
Line 4: Line 4:
Lines in sudo configuration use following format:
Lines in sudo configuration use following format:
<pre>
<pre>
<username> or <group> <machine> = [(<user>)] [NOPASSWD] :<command1> [, <command2> ...]
<username> or %<group> <machine> = [(<user>)] [NOPASSWD] :<command1> [, <command2> ...]
</pre>
</pre>
Note that group is indicated using %sign.


For example:
For example:

Revision as of 03:42, 9 April 2014

<yambe:breadcrumb>Sudo configuration</yambe:breadcrumb>

Sudo configuration syntax

Lines in sudo configuration use following format:

<username> or %<group> <machine> = [(<user>)] [NOPASSWD] :<command1> [, <command2> ...]

Note that group is indicated using %sign.


For example:

saurabh barjatiya = (root) NOPASSWD: /usr/sbin/wireshark, /usr/sbin/tcpdump

will allow user 'saurabh' to run '/usr/sbin/wireshark' and '/usr/sbin/tcpdump' commands on machine 'barjatiya' without supplying password as root user.




<yambe:breadcrumb>Sudo configuration</yambe:breadcrumb>