Skip to content

Instantly share code, notes, and snippets.

@t11a
Last active December 16, 2015 13:39
Show Gist options
  • Save t11a/5443559 to your computer and use it in GitHub Desktop.
Save t11a/5443559 to your computer and use it in GitHub Desktop.
多段SSH、ssh/config
Host step_server
User username
Hostname xx.xx.xx.xx (Step Server's IP)
PreferredAuthentications publickey
IdentityFile ~/.ssh/private.key
Port 22
### ssh -Wオプションの場合(最近はこっちのほうがオススメらしい)
Host server_in_private
User username
Hostname xx.xx.xx.xx (Private IP)
Port 22
ProxyCommand ssh -W %h:%p step_server
### netcatの場合
Host server_in_private
User username
Hostname xx.xx.xx.xx (Private IP)
Port 22
ProxyCommand ssh step_server nc -w 3600 %h %p (-wでtimeout時間を設定すること)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment