Skip to content

Instantly share code, notes, and snippets.

@jordiclariana
Created April 19, 2016 19:20
Show Gist options
  • Save jordiclariana/b50fbb080f3023acd5e8a71696cb2f4d to your computer and use it in GitHub Desktop.
Save jordiclariana/b50fbb080f3023acd5e8a71696cb2f4d to your computer and use it in GitHub Desktop.
Enable transparent sudo through authorized_keys, also for scp, rsync, etc.
command="if [ -n \"$SSH_ORIGINAL_COMMAND\" ]; then sudo /bin/bash -c \"$SSH_ORIGINAL_COMMAND\"; else sudo -i; fi" ssh-rsa AAAA...WXYZ myname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment