Skip to content

Instantly share code, notes, and snippets.

@gildas
Last active August 1, 2018 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gildas/87146064214897b2b50cc7a9c4043112 to your computer and use it in GitHub Desktop.
Save gildas/87146064214897b2b50cc7a9c4043112 to your computer and use it in GitHub Desktop.
Add the current user to the sudoers
#!/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
@gildas
Copy link
Author

gildas commented Mar 26, 2018

curl -sSL https://tinyurl.com/add-to-sudoers | bash -s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment