Skip to content

Instantly share code, notes, and snippets.

@omar-yassin
Last active March 9, 2023 19:09
Show Gist options
  • Save omar-yassin/49252a62e45cbf49b641 to your computer and use it in GitHub Desktop.
Save omar-yassin/49252a62e45cbf49b641 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