Last active
December 28, 2015 03:59
-
-
Save otzoran/7439195 to your computer and use it in GitHub Desktop.
sudo nopass
This file contains 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
sudo -i | |
if [[ -d /etc/sudoers.d ]]; then | |
echo "ori ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/ori | |
chmod 440 !$ | |
chown root:root !$ #match the owner && perms of README | |
elif [[ -e /etc/sudoers ]]; then | |
echo "ori ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
else | |
echo "Failed to add ori to sudoers" | |
fi | |
# stay in this TTY as root | |
visudo -c | |
# expect: /etc/sudoers: parsed OK | |
# if not, MUST fix it (risk: unable to sudo) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment