1#
2# Sample /etc/sudoers file.
3#
4# This file MUST be edited with the 'visudo' command as root.
5#
6# See the sudoers man page for the details on how to write a sudoers file.
7#
8
9##
10# User alias specification
11##
12User_Alias	FULLTIMERS = millert, mikef, dowdy
13User_Alias	PARTTIMERS = bostley, jwfox, crawl
14User_Alias	WEBMASTERS = will, wendy, wim
15
16##
17# Runas alias specification
18##
19Runas_Alias	OP = root, operator
20Runas_Alias	DB = oracle, sybase
21
22##
23# Host alias specification
24##
25Host_Alias	SPARC = bigtime, eclipse, moet, anchor:\
26		SGI = grolsch, dandelion, black:\
27		ALPHA = widget, thalamus, foobar:\
28		HPPA = boa, nag, python
29Host_Alias	CUNETS = 128.138.0.0/255.255.0.0
30Host_Alias	CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0
31Host_Alias	SERVERS = master, mail, www, ns
32Host_Alias	CDROM = orion, perseus, hercules
33
34##
35# Cmnd alias specification
36##
37Cmnd_Alias	DUMPS = /usr/sbin/dump, /usr/sbin/rdump, /usr/sbin/restore, \
38			/usr/sbin/rrestore, /usr/bin/mt
39Cmnd_Alias	KILL = /usr/bin/kill
40Cmnd_Alias	PRINTING = /usr/sbin/lpc, /usr/bin/lprm
41Cmnd_Alias	SHUTDOWN = /usr/sbin/shutdown
42Cmnd_Alias	HALT = /usr/sbin/halt
43Cmnd_Alias	REBOOT = /usr/sbin/reboot
44Cmnd_Alias	SHELLS = /sbin/sh, /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \
45			 /usr/local/bin/tcsh, /usr/bin/rsh, \
46			 /usr/local/bin/zsh
47Cmnd_Alias	SU = /usr/bin/su
48Cmnd_Alias	VIPW = /usr/sbin/vipw, /usr/bin/passwd, /usr/bin/chsh, \
49		       /usr/bin/chfn
50
51##
52# Override built-in defaults
53##
54Defaults               syslog=auth
55Defaults>root          !set_logname
56Defaults:FULLTIMERS    !lecture
57Defaults:millert       !authenticate
58Defaults@SERVERS       log_year, logfile=/var/log/sudo.log
59
60##
61# User specification
62##
63
64# root and users in group wheel can run anything on any machine as any user
65root		ALL = (ALL) ALL
66%wheel		ALL = (ALL) ALL
67
68# full time sysadmins can run anything on any machine without a password
69FULLTIMERS	ALL = NOPASSWD: ALL
70
71# part time sysadmins may run anything but need a password
72PARTTIMERS	ALL = ALL
73
74# jack may run anything on machines in CSNETS
75jack		CSNETS = ALL
76
77# lisa may run any command on any host in CUNETS (a class B network)
78lisa		CUNETS = ALL
79
80# operator may run maintenance commands and anything in /usr/oper/bin/
81operator	ALL = DUMPS, KILL, SHUTDOWN, HALT, REBOOT, PRINTING,\
82		sudoedit /etc/printcap, /usr/oper/bin/
83
84# joe may su only to operator
85joe		ALL = /usr/bin/su operator
86
87# pete may change passwords for anyone but root on the hp snakes
88pete		HPPA = /usr/bin/passwd [A-z]*, !/usr/bin/passwd root
89
90# bob may run anything on the sparc and sgi machines as any user
91# listed in the Runas_Alias "OP" (ie: root and operator)
92bob		SPARC = (OP) ALL : SGI = (OP) ALL
93
94# jim may run anything on machines in the biglab netgroup
95jim		+biglab = ALL
96
97# users in the secretaries netgroup need to help manage the printers
98# as well as add and remove users
99+secretaries	ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser
100
101# fred can run commands as oracle or sybase without a password
102fred		ALL = (DB) NOPASSWD: ALL
103
104# on the alphas, john may su to anyone but root and flags are not allowed
105john		ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*
106
107# jen can run anything on all machines except the ones
108# in the "SERVERS" Host_Alias
109jen		ALL, !SERVERS = ALL
110
111# jill can run any commands in the directory /usr/bin/, except for
112# those in the SU and SHELLS aliases.
113jill		SERVERS = /usr/bin/, !SU, !SHELLS
114
115# steve can run any command in the directory /usr/local/op_commands/
116# as user operator.
117steve		CSNETS = (operator) /usr/local/op_commands/
118
119# matt needs to be able to kill things on his workstation when
120# they get hung.
121matt		valkyrie = KILL
122
123# users in the WEBMASTERS User_Alias (will, wendy, and wim)
124# may run any command as user www (which owns the web pages)
125# or simply su to www.
126WEBMASTERS	www = (www) ALL, (root) /usr/bin/su www
127
128# anyone can mount/unmount a cd-rom on the machines in the CDROM alias
129ALL		CDROM = NOPASSWD: /sbin/umount /CDROM,\
130		/sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM
131