如何修复';刀引导ssh连接到客户端问题';厨师?

如何修复';刀引导ssh连接到客户端问题';厨师?,ssh,chef-infra,knife,Ssh,Chef Infra,Knife,我正在尝试使用刀子引导命令从chef工作站添加chef客户端节点。但获取的错误消息为“error:Train::Transports::SSHFailed:SSH会话无法建立” 我已禁用chef客户端上的iptables [root@chefclient ~]# service iptables status Redirecting to /bin/systemctl status iptables.service iptables.service - IPv4 firewall with i

我正在尝试使用刀子引导命令从chef工作站添加chef客户端节点。但获取的错误消息为“error:Train::Transports::SSHFailed:SSH会话无法建立”

我已禁用chef客户端上的iptables

[root@chefclient ~]# service iptables status
Redirecting to /bin/systemctl status  iptables.service
iptables.service - IPv4 firewall with iptables
   Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled)
   Active: inactive (dead)

Jul 29 16:21:18 chefclient.jp.com systemd[1]: [/usr/lib/systemd/system/iptables.service:5] Unknown lvalue 'AssertPathExists' in... 'Unit'
Hint: Some lines were ellipsized, use -l to show in full

'''knife bootstrap 192.168.56.6 -N chefclient.jp.com -U root --sudo -i /root/Downloads/chefsetup.pem'''

Getting result as:
Connecting to 192.168.56.6
WARN: [SSH] PTY requested: stderr will be merged into stdout
The authenticity of host '192.168.56.6 ()' can't be established.
fingerprint is SHA256:8x0e7QPub3Zj/2GFz5XSFZCABEbez6uVV/eR1MvYoIE.

Are you sure you want to continue connecting
? (Y/N) Y
WARN: [SSH] PTY requested: stderr will be merged into stdout
WARN: [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user root@192.168.56.6>)
ERROR: Train::Transports::SSHFailed: SSH session could not be established
[root@chefclient~]#服务iptables状态
重定向到/bin/systemctl状态iptables.service
iptables.service-带iptables的IPv4防火墙
已加载:已加载(/usr/lib/systemd/system/iptables.service;已禁用)
活动:非活动(死)
7月29日16:21:18 chefclient.jp.com systemd[1]:[/usr/lib/systemd/system/iptables.service:5]未知左值“AssertPathExists”位于…'单位的
提示:有些行已省略,请使用-l完整显示
“刀锋引导192.168.56.6-N chefclient.jp.com-U root-sudo-i/root/Downloads/chefsetup.pem”
得到的结果如下:
连接到192.168.56.6
警告:[SSH]PTY请求:stderr将合并到stdout中
无法建立主机“192.168.56.6()”的真实性。
指纹是SHA256:8x0e7QPub3Zj/2GFz5XSFZCABEbez6uVV/eR1MvYoIE。
您确定要继续连接吗
? (是/否)是
警告:[SSH]PTY请求:stderr将合并到stdout中
警告:[SSH]连接失败,正在终止(#)
错误:Train::Transports::SSHFailed:无法建立SSH会话

在从chef server webui下载了knife.rb文件oraganization-validator.pem并保存在chefstation的.chef目录中,并按如下方式运行knife引导命令后,该问题得到修复

''刀引导192.168.56.6-N chefclient.jp.com-U根''

输出:

Connecting to 192.168.56.6
WARN: [SSH] PTY requested: stderr will be merged into stdout
The authenticity of host '192.168.56.6 ()' can't be established.
fingerprint is SHA256:8x0e7QPub3Zj/2GFz5XSFZCABEbez6uVV/eR1MvYoIE.

Are you sure you want to continue connecting
? (Y/N) Y
WARN: [SSH] PTY requested: stderr will be merged into stdout
Performing legacy client registration with the validation key at /root/chef-repo/.chef/short_name-validator.pem...
                                                                                                           Delete your validation key in order to use your user credentials for client registration instead.
Bootstrapping 192.168.56.6
 [192.168.56.6] -----> Installing Chef Omnibus (stable/15)
downloading https://omnitruck.chef.io/chef/install.sh
......................................................
......................................................

[192.168.56.6] Thank you for installing Chef Infra Client! For help getting started visit https://learn.chef.io
 [192.168.56.6] Starting the first Chef Infra Client Client run...
 [192.168.56.6] Starting Chef Infra Client, version 15.1.36
 [192.168.56.6] Creating a new client identity for chefclient.jp.com using the validator key.
 [192.168.56.6] resolving cookbooks for run list: []
 [192.168.56.6] Synchronizing Cookbooks:
 [192.168.56.6] Installing Cookbook Gems:
Compiling Cookbooks...
[2019-07-30T13:12:01+05:30] WARN: Node chefclient.jp.com has an empty run list.
 [192.168.56.6] Converging 0 resources
这有帮助

ssh-keyscan host-ip-address >> $HOME/.ssh/known_hosts