Created
August 12, 2012 08:04
-
-
Save n0b0dy/3330605 to your computer and use it in GitHub Desktop.
sudo no passwd
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
| platform="$(lsb_release -i -s)" | |
| sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers | |
| case "$platform" in | |
| Debian) | |
| sed -i -e 's/%sudo ALL=(ALL) ALL/%sudo ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers | |
| ;; | |
| Ubuntu) | |
| groupadd -r admin || true | |
| usermod -a -G admin $account | |
| sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment