Advance ssh config file

后端 未结 1 1007
面向向阳花
面向向阳花 2020-12-10 09:47

How to ssh directly to Remote Server, below is the details description.

Local machine ---> Jump1 ----> Jump2 ----> Remote Server

相关标签:
1条回答
  • 2020-12-10 10:41

    Set your ~/.ssh/config:

    Host Jump1
      User jump1user
      Port 2222
    Host Jump2
      ProxyCommand ssh -W %h:%p Jump1
      User jump2user
    Host RemoveServer
      ProxyCommand ssh -W %h:%p Jump2
      User remoteUser
    

    Or with new OpenSSH 7.3:

    Host RemoveServer
      ProxyJump jump1user@Jump1,jump2user@Jump2
      User remoteUser
    

    Then you can connect simply using ssh RemoteServer

    0 讨论(0)
提交回复
热议问题