Last active
December 11, 2015 04:28
-
-
Save toshimaru/4544762 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/sh | |
PS3="Which host? > " | |
select host in `cat ~/.ssh/config | egrep '^Host' | cut -d ' ' -f 2`; do | |
[[ $host ]] && { | |
echo "ssh connect to $host" | |
ssh $host | |
break; | |
} | |
done |
This file contains hidden or 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
# ~/.ssh/config example | |
Host myhost1 | |
HostName example.com | |
User toshi | |
IdentityFile ~/.ssh/your_id_rsa | |
Host myhost2 | |
HostName 192.168.xx.xx | |
User toshi | |
ProxyCommand ssh myhost1 nc %h %p | |
ServerAliveInterval 60 | |
ServerAliveCountMax 120 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment