Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Chef infra 具有多个跳转主机的刀片ssh_Chef Infra_Knife - Fatal编程技术网

Chef infra 具有多个跳转主机的刀片ssh

Chef infra 具有多个跳转主机的刀片ssh,chef-infra,knife,Chef Infra,Knife,我有一个网络,需要两个跳转主机才能从我的工作站进入。我的~/.ssh/config如下所示: 主机*.mgmt.example.com ProxyJump admin-1.prod.example.com,jump-1.example.com 这对于常规ssh很好,但我似乎无法让刀子ssh连接。我尝试将--ssh gateway admin-1.prod.example.com、jump-2.example.com添加到命令中,但它似乎也不起作用。有可能让ssh通过两个代理吗 基于上面的.s

我有一个网络,需要两个跳转主机才能从我的工作站进入。我的~/.ssh/config如下所示:

主机*.mgmt.example.com
ProxyJump admin-1.prod.example.com,jump-1.example.com

这对于常规ssh很好,但我似乎无法让刀子ssh连接。我尝试将
--ssh gateway admin-1.prod.example.com、jump-2.example.com
添加到命令中,但它似乎也不起作用。有可能让ssh通过两个代理吗

基于上面的.ssh/config条目的示例命令:
ssh“名称:host-1.mgmt.example.com”“主机名”


net ssh-gateway
不直接支持多跳,但是
net ssh
中内置的proxyjump支持应该在您使用最新的ChefDK时提供。有关详细信息,请参阅。

您是说应该支持我的
~/.ssh/config
中的
ProxyJump
设置,还是我必须指定一些内容?我有最新的chefdk,但它似乎仍然不起作用。您正在运行的完整命令是什么?您需要通过主机名(而不是IP)进行连接,这样才能激活
Host
glob。我正在使用主机名。目前除了我的
~/.ssh/config
之外,我没有任何与ProxyJump相关的设置。Chef认为机器FQDN是什么?是计算要连接到的属性名称的代码,或者您可以使用
-a
选项将其覆盖到
ssh
。确保名称与您的glob匹配。另外,您使用的是什么版本的ChefDK?我使用的名称与FQDN不匹配。为了以防万一,我尝试在命令中添加了一个fqdn,但似乎没有什么不同。我将在主要问题的主体中向同一主机添加ssh vs刀子ssh的输出,以供参考。
numb3rs1x@workstation~:chef --version
Chef Development Kit Version: 3.2.30
chef-client version: 14.4.56
delivery version: master (6862f27aba89109a9630f0b6c6798efec56b4efe)
berks version: 7.0.6
kitchen version: 1.23.2
inspec version: 2.2.70

numb3rs1x@workstation~:knife ssh "name:host-1.mgmt.example.com" "hostname" -a fqdn
WARNING: Failed to connect to host-1.mgmt.example.com -- Net::SSH::Proxy::ConnectError: command timed out: ssh -J jump-1.example.com -W host-1.mgmt.example.com:22 admin-1.prod.example.com
ssh: connect to host jump-1.example.com port 22: Operation timed out
ssh_exchange_identification: Connection closed by remote host

numb3rs1x@workstation~:ssh host-1.mgmt.example.com
Warning: Permanently added 'admin-1.prod.example.com,10.5.0.9' (ECDSA) to the list of known hosts.
Warning: Permanently added 'jump-1.example.com' (ECDSA) to the list of known hosts.
Warning: Permanently added 'host-1.mgmt.example.com' (ECDSA) to the list of known hosts.
numb3rs1x@host-1:~$