ssh - 如何在Chef中修复 'knife bootstrap ssh connection to client issue'?

标签 ssh chef-infra knife

我正在尝试使用小刀引导命令从Chef工作站添加一个Chef客户端节点,但是得到的错误消息为'''ERROR:Train::Transports::SSHFailed:无法建立SSH session '''

我在厨师客户端上禁用了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

最佳答案

从Chef服务器webui下载knife.rb文件,oraganization-validator.pem并保存在Chefstation的.chef目录中,并运行如下所示的boots bootstrap命令后,此问题已修复。

'''刀引导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 - 如何在Chef中修复 'knife bootstrap ssh connection to client issue'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57254211/

相关文章:

php - 如何通过ssh连接php应用程序和远程mysql数据库

ssh - 无法使用 knife ssh 访问我的 EC2 Chef 节点

linux - 为什么 Chef 找不到我的文件?

ssh - 与主管自动 ssh 连接

authentication - 在不使用公钥身份验证或期望的情况下自动化 SSH(1)

ruby - 使用 Knife 更新 Chef 中的运行列表

python - 使用 Chef Python Cookbook 为我的 virtualenv 指定不同的 Python 版本

ruby - stub include_recipe 调用以不采取任何操作,但仍将配方计为包含的内容

windows - 我可以将 knife.rb 作为参数传递给 knife 命令吗?

php - 在 PHP 中不错的 ssh2