Last active
August 1, 2018 16:43
-
-
Save gildas/87146064214897b2b50cc7a9c4043112 to your computer and use it in GitHub Desktop.
Add the current user to the sudoers
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/sh | |
if [ -z "$1" ] ; then userid=$(whoami); else userid=$1; fi | |
sudo tee /etc/sudoers.d/${userid} > /dev/null <<EOF | |
${userid} ALL=(root) NOPASSWD:ALL | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -sSL https://tinyurl.com/add-to-sudoers | bash -s