Last active
October 16, 2016 08:30
-
-
Save sbruggmann/09ca24f82b7e55e053a7a4bfb5a62d6a to your computer and use it in GitHub Desktop.
bash ssh shortcut
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
# add "source ~/.bash_ssh" to your .bash_profile | |
# execute ssh-add-shortcut | |
ssh-add-shortcut() { | |
if [ -z "$1" ]; then | |
echo "" | |
echo "add and open:" | |
echo "# ssh-add-shortcut MyShortname user@server.com" | |
echo "" | |
echo "open:" | |
echo "# ssh-MyShortname" | |
echo "" | |
fi | |
if [ -n "$1" ]; then | |
echo "alias ssh-$1='ssh $2 $3'" >> ~/.bash_ssh; | |
ssh $2 $3; | |
fi | |
} | |
# added ssh connections.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment