ffcdc7d
## Sudoers allows particular users to run various commands as
ffcdc7d
## the root user, without needing the root password.
ffcdc7d
##
ffcdc7d
## Examples are provided at the bottom of the file for collections
ffcdc7d
## of related commands, which can then be delegated out to particular
ffcdc7d
## users or groups.
ffcdc7d
## 
ffcdc7d
## This file must be edited with the 'visudo' command.
ffcdc7d
ffcdc7d
## Host Aliases
ffcdc7d
## Groups of machines. You may prefer to use hostnames (perhaps using 
ffcdc7d
## wildcards for entire domains) or IP addresses instead.
ffcdc7d
# Host_Alias     FILESERVERS = fs1, fs2
ffcdc7d
# Host_Alias     MAILSERVERS = smtp, smtp2
ffcdc7d
ffcdc7d
## User Aliases
ffcdc7d
## These aren't often necessary, as you can use regular groups
ffcdc7d
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname 
ffcdc7d
## rather than USERALIAS
ffcdc7d
# User_Alias ADMINS = jsmith, mikem
ffcdc7d
ffcdc7d
ffcdc7d
## Command Aliases
ffcdc7d
## These are groups of related commands...
ffcdc7d
ffcdc7d
## Networking
ffcdc7d
# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool
ffcdc7d
ffcdc7d
## Installation and management of software
ffcdc7d
# Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum
ffcdc7d
ffcdc7d
## Services
4e850fe
# Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig, /usr/bin/systemctl start, /usr/bin/systemctl stop, /usr/bin/systemctl reload, /usr/bin/systemctl restart, /usr/bin/systemctl status, /usr/bin/systemctl enable, /usr/bin/systemctl disable
ffcdc7d
ffcdc7d
## Updating the locate database
ffcdc7d
# Cmnd_Alias LOCATE = /usr/bin/updatedb
ffcdc7d
ffcdc7d
## Storage
ffcdc7d
# Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount
ffcdc7d
ffcdc7d
## Delegating permissions
ffcdc7d
# Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp 
ffcdc7d
ffcdc7d
## Processes
ffcdc7d
# Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall
ffcdc7d
ffcdc7d
## Drivers
ffcdc7d
# Cmnd_Alias DRIVERS = /sbin/modprobe
ffcdc7d
ffcdc7d
# Defaults specification
ffcdc7d
ffcdc7d
#
ffcdc7d
# Refuse to run if unable to disable echo on the tty.
ffcdc7d
#
ffcdc7d
Defaults   !visiblepw
ffcdc7d
4e850fe
#
4e850fe
# Preserving HOME has security implications since many programs
4e850fe
# use it when searching for configuration files. Note that HOME
4e850fe
# is already set when the the env_reset option is enabled, so
4e850fe
# this option is only effective for configurations where either
4e850fe
# env_reset is disabled or HOME is present in the env_keep list.
4e850fe
#
4e850fe
Defaults    always_set_home
4e850fe
Defaults    match_group_by_gid
4e850fe
4e850fe
# Prior to version 1.8.15, groups listed in sudoers that were not
4e850fe
# found in the system group database were passed to the group
4e850fe
# plugin, if any. Starting with 1.8.15, only groups of the form
4e850fe
# %:group are resolved via the group plugin by default.
4e850fe
# We enable always_query_group_plugin to restore old behavior.
4e850fe
# Disable this option for new behavior.
4e850fe
Defaults    always_query_group_plugin
4e850fe
ffcdc7d
Defaults    env_reset
d3ea02b
Defaults    env_keep =  "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS"
cd84c55
Defaults    env_keep += "MAIL QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
ffcdc7d
Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
ffcdc7d
Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
ffcdc7d
Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
ffcdc7d
4e850fe
#
4e850fe
# Adding HOME to env_keep may enable a user to run unrestricted
4e850fe
# commands via sudo.
4e850fe
#
4e850fe
# Defaults   env_keep += "HOME"
4e850fe
35c555c
Defaults    secure_path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin
ffcdc7d
ffcdc7d
## Next comes the main part: which users can run what software on 
ffcdc7d
## which machines (the sudoers file can be shared between multiple
ffcdc7d
## systems).
ffcdc7d
## Syntax:
ffcdc7d
##
ffcdc7d
## 	user	MACHINE=COMMANDS
ffcdc7d
##
ffcdc7d
## The COMMANDS section may have other options added to it.
ffcdc7d
##
ffcdc7d
## Allow root to run any commands anywhere 
ffcdc7d
root	ALL=(ALL) 	ALL
ffcdc7d
ffcdc7d
## Allows members of the 'sys' group to run networking, software, 
ffcdc7d
## service management apps and more.
ffcdc7d
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
ffcdc7d
ffcdc7d
## Allows people in group wheel to run all commands
ffcdc7d
%wheel	ALL=(ALL)	ALL
ffcdc7d
ffcdc7d
## Same thing without a password
ffcdc7d
# %wheel	ALL=(ALL)	NOPASSWD: ALL
ffcdc7d
ffcdc7d
## Allows members of the users group to mount and unmount the 
ffcdc7d
## cdrom as root
ffcdc7d
# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom
ffcdc7d
ffcdc7d
## Allows members of the users group to shutdown this system
ffcdc7d
# %users  localhost=/sbin/shutdown -h now
ffcdc7d
ffcdc7d
## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
ffcdc7d
#includedir /etc/sudoers.d