cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

os:linux:user:sudo.html



sudo - How to Configure sudo in Linux

Configuration

Example

Permit

root ALL=(ALL) ALL
user01 ALL=(ALL) NOPASSWD:ALL
apache ALL=(user01) NOPASSWD:ALL

Deny

Cmnd_Alias SHUTDOWN = /sbin/halt, /sbin/shutdown, /sbin/poweroff, /sbin/reboot, /sbin/fastboot, /sbin/init
Cmnd_Alias REMOVE = /bin/rm, /usr/sbin/unlink, /bin/rmdir

%dev ALL=(ALL) ALL, !SHUTDOWN,!REMOVE
#deny "sudo -s"
Cmnd_Alias SHELLS = /bin/sh, /bin/csh, /bin/tcsh, /bin/bash, /usr/local/bin/bash
Cmnd_Alias SHELLS_NONINTERACTIVE = /bin/sh -c *, /bin/csh -c *,/bin/tcsh -c *, /usr/local/bin/bash -c *

%dev ALL=(ALL) ALL, !SHELLS, SHELLS_NONINTERACTIVE



os/linux/user/sudo.html.txt ยท Last modified: 2020/04/12 by admin

Page Tools