在〜/ .ssh / config中替换ProxyJump


32

我正在用ProxyJump我的~/.ssh/config

Host jump                                                                          
  User jane                                                                       
  HostName 1.2.3.4
  DynamicForward 1028
Host dev                                                                        
  User bill                                                                      
  HostName 5.6.7.8                                                          
  ProxyJump jump

我的同事正在使用旧版本的ssh(他们无法更新)。允许它们通过跳转主机连接的等效配置是什么?将DynamicForward仍然工作?


您的同事使用什么版本的ssh?
Kenster

它是OSX 10.10版本-ssh6.x。
索尼娅·汉密尔顿

Answers:


43

ProxyJump是在OpenSSH 7.3中添加的,但仅是使用的简写ProxyCommand,例如:

Host hidden-host
  ProxyCommand ssh proxy-host -W %h:%p

如果您的ssh版本更高,则可能缺少该-W选项,在这种情况下,您可以使用nc,例如:

Host hidden-host
  ProxyCommand ssh proxy-host nc %h %p 2> /dev/null

7
在终端/ cmd中,它看起来像这样:ssh -o ProxyCommand="ssh <proxy-host> -W %h:%p" <target>而不是ssh -J <proxy-host> <target>
igor,
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.