0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ssh接続した先の端末のdockerへssh接続するssh.configの書き方

Last updated at Posted at 2021-02-01
Host EC2
    HostName {IP_ADRESS}
    User ubuntu
    IdentityFile {EC2 rsa path}
    CheckHostIP no
    ControlMaster auto
    ControlPersist  600
    IdentitiesOnly yes
    ForwardAgent yes
    RemoteForward 22 127.0.0.1:22
    ServerAliveInterval 60
    ServerAliveCountMax 3
Host EC2_docker
    HostName 127.0.0.1
    User root
    Port {docker ssh port}
    IdentityFile {EC2 docker's rsa path}
    ProxyCommand ssh -W %h:%p EC2

windowsで設定するとき、
多段sshのopensshのバージョンによっては

“posix_spawn: No such file or directory”

というエラーが出るのでその時はgit for windowsが入っていれば以下を設定

    ProxyCommand C:\Windows\System32\OpenSSH\ssh.exe -W %h:%p EC2

参考サイト
https://teratail.com/questions/212441

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?