Skip to content

Instantly share code, notes, and snippets.

@s4parke
Created December 6, 2016 17:43
Show Gist options
  • Save s4parke/ed918d46e9f14e180a279c258661f78a to your computer and use it in GitHub Desktop.
Save s4parke/ed918d46e9f14e180a279c258661f78a to your computer and use it in GitHub Desktop.
Debian/Ubuntu VISUDO config: allows users in group 'staff' to do basic admin without a password
# /etc/sudoers.d/visudo-deb-conf (root:root, 0440)
#
# Visudo configuration for Debian (and Ubuntu?) systems
# Allows users in group 'staff' to do basic admin without a password
#
# Setup:
# groupadd staff
# usermod -a -G staff shuti
# chown root:root && chmod 0440 visudo-deb-conf
# cp ~/visudo-deb-conf /etc/sudoers.d/
# # test it out
## Control (start|stop|restart) web, database, memcached
Cmnd_Alias SERVICES = /etc/init.d/apache2, /etc/init.d/nginx, /etc/init.d/mysql, /etc/init.d/memcached
## Restart the system
Cmnd_Alias REBOOT = /sbin/reboot
## Filesystem commands
Cmnd_Alias FILES = /bin/chmod, /bin/chown, /bin/chgrp
## Allow users in group 'staff' to administer basic stuff without a password
%staff ALL=(ALL) NOPASSWD:SERVICES,REBOOT,FILES
## Anyone can kill a process without password
ALL ALL =(ALL) NOPASSWD:/bin/kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment