刀零 - SSH::Exception 远程转发请求失败

Knife zero - SSH::Exception remote forwarding request failed

我一直在尝试在我的机器上执行 knife zero bootstrap 命令,但我总是收到此错误。另外,我可以使用 SSH 命令直接连接到目标服务器。

ERROR: Net::SSH::Exceptionremote forwarding request failed
ERROR: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/service/forward.rb:178:in `block in remote'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:505:in `call'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:505:in `request_failure'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:466:in `dispatch_incoming_packets'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:222:in `preprocess'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/server.rb:205:in `preprocess'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/session.rb:449:in `block in preprocess'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/server_list.rb:47:in `block in each'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/server_list.rb:45:in `each'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/server_list.rb:45:in `each'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/session.rb:449:in `preprocess'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/session.rb:430:in `process'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/session.rb:417:in `block in loop'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/session.rb:417:in `loop'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-multi-1.2.1/lib/net/ssh/multi/session.rb:417:in `loop'
/opt/chefdk/embedded/apps/chef/lib/chef/knife/ssh.rb:280:in `ssh_command'
/home/<user>/.chefdk/gem/ruby/2.1.0/gems/knife-zero-1.3.0/lib/knife-zero/bootstrap_ssh.rb:23:in `ssh_command'
/opt/chefdk/embedded/apps/chef/lib/chef/knife/ssh.rb:526:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/knife/bootstrap.rb:333:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/knife.rb:422:in `block in run_with_pretty_exceptions'
/opt/chefdk/embedded/apps/chef/lib/chef/local_mode.rb:39:in `with_server_connectivity'
/opt/chefdk/embedded/apps/chef/lib/chef/knife.rb:421:in `run_with_pretty_exceptions'
/opt/chefdk/embedded/apps/chef/lib/chef/knife.rb:214:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/application/knife.rb:142:in `run'
/opt/chefdk/embedded/apps/chef/bin/knife:25:in `<top (required)>'
/usr/bin/knife:51:in `load'
/usr/bin/knife:51:in `<main>'

我已经在 /etc/ssh/sshd_config 文件中启用了 AllowTcpForwarding 并在执行命令之前终止了目标服务器上所有现有的 SSH 连接,但没有任何效果。

通过将 knife-zero 升级到更新版本设法让它工作。 但是我不明白为什么旧版本可以在其他环境下工作。