Created
January 6, 2011 21:20
-
-
Save zerowidth/768601 to your computer and use it in GitHub Desktop.
sshr for "ssh as root", but using sudo
This file contains 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
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