替換 ~/.ssh/config 中的 ProxyJump

替換 ~/.ssh/config 中的 ProxyJump

我正在使用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工作嗎?

答案1

ProxyJump已在 OpenSSH 7.3 中添加,但只不過是 using 的簡寫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

相關內容