Created
July 6, 2015 14:28
-
-
Save cecilemuller/76182cd29d74336291e4 to your computer and use it in GitHub Desktop.
Programatically patch sudoers to make group "sudo" passwordless
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
#!/bin/bash | |
sudo cp /etc/sudoers /etc/sudoers.bak | |
sudo cp /etc/sudoers /etc/sudoers.tmp | |
sudo chmod 0640 /etc/sudoers.tmp | |
sudo sed -i 's/%sudo ALL=(ALL:ALL) ALL/%sudo ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers.tmp | |
sudo chmod 0440 /etc/sudoers.tmp | |
sudo mv /etc/sudoers.tmp /etc/sudoers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment