Skip to content

Instantly share code, notes, and snippets.

@zerowidth
Created January 6, 2011 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerowidth/768601 to your computer and use it in GitHub Desktop.
Save zerowidth/768601 to your computer and use it in GitHub Desktop.
sshr for "ssh as root", but using sudo
function sshr() {
if [ -n "$1" ]; then
if [ -n "$2" ]; then
ssh -t $1 sudo $2
else
ssh -t $1 sudo su -
fi
else
echo "... specify a host, n00b"
fi
}
complete -F _ssh sshr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment