执行时:
knife bootstrap {{IP}} --ssh-user centos --ssh-password '' \
--sudo --use-sudo-password --node-name node1 \
--run-list 'recipe[learn_chef_httpd]'
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
ERROR: Net::SSH::AuthenticationFailed: Authentication failed for user centos@{{IP}}@{{IP}}
Run Code Online (Sandbox Code Playgroud)
我正在尝试连接到没有密码的 centos 用户,因为我想使用 SSH-Key Auth。
我试过传递一些排列:
knife bootstrap {{IP}} -x centos -i .chef/james-chef-validator.pem --sudo --run-list 'recipe[learn_chef_httpd]'
Run Code Online (Sandbox Code Playgroud)
都没有成功...
如果使用 -VV 运行:
...
DEBUG: allowed methods: publickey,gssapi-keyex,gssapi-with-mic
DEBUG: none failed
DEBUG: trying publickey
DEBUG: connecting to ssh-agent
ERROR: could not connect to ssh-agent
ERROR: all authorization methods failed (tried none, publickey)
ERROR: Net::SSH::AuthenticationFailed: Authentication failed for user centos@{{IP}}@{{IP}}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
修复!
因此,当您使用托管厨师时,您需要使用引导程序传递私钥,并在您的 autherized_keys 文件中包含公钥....
~/chef-repossh-keygen$ cat id_rsa.pub >> authorized_keys使用以下命令运行刀具引导程序:
sudo knife bootstrap {{server-ip}} --ssh-user {{your-server-user}} -i ~/.ssh/id_rsa --sudo --node-name web1
那应该工作!
我还建议您作为 --ssh-user 传递的用户具有无密码 sudo 访问权限。
| 归档时间: |
|
| 查看次数: |
12291 次 |
| 最近记录: |