来自 Chef 服务器的引导节点失败,并出现 SSH 错误

bootstrapping node from chef server failing with SSH error

提问人:Prince kumar 提问时间:10/8/2023 最后编辑:seshadri_cPrince kumar 更新时间:10/9/2023 访问量:30

问:

我运行此命令以使用 chef 服务器引导节点,该服务器将在节点上安装 chef-client。

[root@ip-172-31-23-178 chef-repo]# knife bootstrap 172.31.20.187 --ssh-user ec2-user --sudo -i node1.key.pem -N  node1

预期:连接已成功建立,并在节点上安装了 chef 客户端。

但它失败了,出现以下错误:

/opt/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.300/lib/chef/knife/bootstrap.rb:31: warning: already initialized constant Chef::Knife::Bootstrap::SUPPORTED_CONNECTION_PROTOCOLS
/opt/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.300/lib/chef/knife/bootstrap.rb:31: warning: previous definition of SUPPORTED_CONNECTION_PROTOCOLS was here
/opt/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.300/lib/chef/knife/bootstrap.rb:32: warning: already initialized constant Chef::Knife::Bootstrap::WINRM_AUTH_PROTOCOL_LIST
/opt/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.300/lib/chef/knife/bootstrap.rb:32: warning: previous definition of WINRM_AUTH_PROTOCOL_LIST was here
/opt/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.300/lib/chef/knife/bootstrap.rb:350: warning: already initialized constant Chef::Knife::Bootstrap::DEPRECATED_FLAGS
/opt/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.300/lib/chef/knife/bootstrap.rb:350: warning: previous definition of DEPRECATED_FLAGS was here
WARNING: You provided --ssh-user. This flag is deprecated. Please use '--connection-user USERNAME' instead.
Node node1 exists, overwrite it? (Y/N) Y
Client node1 exists, overwrite it? (Y/N) Y
Creating new client for node1
Creating new node for node1
Connecting to 172.31.20.187
WARN: [SSH] PTY requested: stderr will be merged into stdout
The authenticity of host '172.31.20.187 ()' can't be established.
fingerprint is SHA256:D8xTTFWkuLv3KUaJWCRjzzAl5Li2XJRlKsaQGux/jWA.
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 [email protected]>)
ERROR: Train::Transports::SSHFailed: SSH session could not be established
[root@ip-172-31-23-178 chef-repo]#
厨师-基础设施

评论

0赞 seshadri_c 10/8/2023
嗨,欢迎来到 SO。正如错误所说,您应该确保能够使用用户名和SSH密钥通过SSH连接到计算机。Authentication failed for user ec2-user
0赞 Prince kumar 10/9/2023
是的,@seshadei我可以使用用户名和 SSH 密钥通过 SSH 连接到计算机。
0赞 seshadri_c 10/9/2023
这绝对是SSH身份验证问题。警告中的另一个线索.你可以试试这个。Please use '--connection-user USERNAME'
0赞 Draco Ater 10/18/2023
您是否尝试使用相同的密钥 (node1.key.pem) 从同一台计算机 ssh 到目标服务器?knife bootstrap

答: 暂无答案