Skip to content

Instantly share code, notes, and snippets.

@ik11235
Created April 23, 2014 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik11235/11217668 to your computer and use it in GitHub Desktop.
Save ik11235/11217668 to your computer and use it in GitHub Desktop.
多段SSHの設定を.ssh/configにまとめる ref: http://qiita.com/ik-fib/items/12e4fab4478e360a82a1
host gateway
HostName sshgate.hoge
User hoge
host *-none
ProxyCommand none
Host LocalB-*-out
ProxyCommand ssh -W %h:%p Bgateway-out
Host LocalC-*-out
ProxyCommand ssh -W %h:%p Cgateway-out
Host LocalB-*
ProxyCommand ssh -W %h:%p Bgateway
Host LocalC-*
ProxyCommand ssh -W %h:%p Cgateway
Host *-out
ProxyCommand ssh -W %h:%p gateway
Host *RemoteHost*
HostName RemoteHost
User fuga
Host *Bgateway*
HostName Bgateway
User hogehoge
Host *Cgateway*
HostName Cgateway
User hogehoge
Host *HostA*
HostName HostA
User hogehoge
Host *HostB*
HostName HostB
User hogehoge
Host *HostC*
HostName HostC
User hogehoge
Host *HostD*
HostName HostD
User hogehoge
host gateway
HostName sshgate.hoge
User hoge
Host RemoteHost-out
HostName RemoteHost
User fuga
ProxyCommand ssh -W %h:%p gateway
host gateway
HostName sshgate.hoge
User hoge
Host RemoteHost*
HostName RemoteHost
User fuga
host *-none
ProxyCommand none
Host *-out*
ProxyCommand ssh -W %h:%p gateway
Host LocalB-HostA-out HostA LocalB-HostA-out RemoteHost-out
Host gateway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment