.ssh/config をいじる

sshを使いこなすための7つの設定」を読んで目からウロコ
こんなことができたのかーー知らなかった。

早速設定
私が行った設定は下記の通り

基本設定でsshセッションが切れないように設定を入れる

Host *

ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
ServerAliveInterval 120

hogehoge.example.comにtest-userという名前で接続。

Host hogehoge

HostNamehogehoge.example.com
IdentityFile ~/.ssh/example_com
User test-user

ssh hogehoge.example.com -l test-user -i .ssh/example_com
とやるのを
ssh hogehoge
だけで行ける!!!
これはこれで便利。

踏み台Server経由でのログイン

Host s1-s2

HostName server2.example.com
ProxyCommand ssh server1.example.com nc %h %p

これは複数の認証を自動でやってくるのがらくちん*^o^*

標準でここまでできるとは知らなかった。
今までWindowsでputtyしか使ってなかったから知らなかった。

puttyでも同じことって出来るの??

同じ業界の人の.ssh/config を見てみたいっす。