Skip to content

Instantly share code, notes, and snippets.

@sbruggmann
Last active October 16, 2016 08:30
Show Gist options
  • Save sbruggmann/09ca24f82b7e55e053a7a4bfb5a62d6a to your computer and use it in GitHub Desktop.
Save sbruggmann/09ca24f82b7e55e053a7a4bfb5a62d6a to your computer and use it in GitHub Desktop.
bash ssh shortcut
# 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