概要 AWS とかで踏み台ホスト経由(ここでは AWS っぽく bastion と呼ぶ)で ssh する必要があるなら ~/.ssh/config は↓みたいにしとくのが良いんじゃないかな? Host bastion Hostname bastionのIPアドレス User bastionのユーザ名 # ↓は規定のファイルだったり ssh-agent 使ってれば不要 IdentityFile bastion接続用の秘密鍵ファイル名 # ↓の3つはWindowsでは使えないので諦めて ControlMaster auto ControlPath ~/.ssh/cp-%r@%h:%p ControlPersist 10m Host 好きな接続先名 Hostname 接続先のIPアドレス User 接続先のユーザ名 # ↓は規定のファイルだったり ssh-agent 使ってれば不要 Identi
![多段 ssh するなら ProxyCommand じゃなくて ProxyJump を使おう](https://cdn-ak-scissors.b.st-hatena.com/image/square/3cc8656d43d80eec91c952f1aff5dbf45db21d2f/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--zebQ3iKh--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3A%2525E5%2525A4%25259A%2525E6%2525AE%2525B5%252520ssh%252520%2525E3%252581%252599%2525E3%252582%25258B%2525E3%252581%2525AA%2525E3%252582%252589%252520ProxyCommand%252520%2525E3%252581%252598%2525E3%252582%252583%2525E3%252581%2525AA%2525E3%252581%25258F%2525E3%252581%2525A6%252520ProxyJump%252520%2525E3%252582%252592%2525E4%2525BD%2525BF%2525E3%252581%25258A%2525E3%252581%252586%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3A%2525E3%252581%25258B%2525E3%252582%25258A%2525E3%252582%252584%2525E3%252581%2525BF%2525E3%252581%2525A4%2525E3%252582%25258B%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly96ZW5uLWRldi5naXRodWIuaW8vZGVmYXVsdC1hdmF0YXJzL2Rhcmsvay5wbmc%3D%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)