Created
July 26, 2011 15:03
-
-
Save ju1ius/1106957 to your computer and use it in GitHub Desktop.
Allow current user to shutdown and reboot without password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
PATTERN="$ a\ | |
$(whoami) ALL=\(ALL\) NOPASSWD: /sbin/shutdown, /sbin/reboot | |
" | |
# Edit /etc/sudoers to allow current user to shutdown and reboot without password | |
# Your previous sudoers file will be backed as /etc/sudoers.bak | |
sed -i.bak -e "$PATTERN" /etc/sudoers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment