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