Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 0x07CB/35fb21bf1f03b37aee7202fbcf80bbf3 to your computer and use it in GitHub Desktop.
Save 0x07CB/35fb21bf1f03b37aee7202fbcf80bbf3 to your computer and use it in GitHub Desktop.
SUDOERS cheatsheet
# REMEMBER TO USE VISUDO - you can potentially lock yourself out if sudoers file has parse error
# change visudo editor to VIM
Defaults editor=/usr/bin/vim
# example of /etc/sudoers.d/lbbackup
Cmnd_Alias LS_HARDWARE = /usr/bin/lshw
Cmnd_Alias MOUNT_UDF = /bin/mount -oloop\,rw *
Cmnd_Alias UNMOUNT_UDF = /bin/umount /data/TEMP_UDF_DIR/MOUNT_UDF
lbbackup ALL=(ALL) NOPASSWD: LS_HARDWARE, MOUNT_UDF, UNMOUNT_UDF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment