Last active
May 27, 2019 14:29
-
-
Save maesoser/a30a66d9adcc600ae0faf810248cc377 to your computer and use it in GitHub Desktop.
Now it's recommended to use .ssh/config file instead of the old alias approach, but that does not mean that you've to loss the benefits of the aliases like autocompletion.
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
# copy this code to .bashrc | |
# This loop generates aliases for the hosts you've configured on ./ssh/config. | |
for x in $(grep '^Host' ~/.ssh/*config 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-); do | |
alias "$x"="ssh $x" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment