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