![使用 chef 和 knife 引导 ubuntu ec2 实例](https://linux22.com/image/607358/%E4%BD%BF%E7%94%A8%20chef%20%E5%92%8C%20knife%20%E5%BC%95%E5%AF%BC%20ubuntu%20ec2%20%E5%AE%9E%E4%BE%8B.png)
我正在使用 chef 引导基于 ec2 ubuntu 的 chef 节点,它会创建一个实例,但它会提示Failed to authenticate ubuntu - trying password auth
并要求输入密码。但新创建的 ubuntu ec2 实例不会设置任何类型的密码。抛出错误
ERROR: Net::SSH::AuthenticationFailed: [email protected]
我该如何绕过此事件,以及问题是什么,我是否必须对配置进行任何更改。
请帮助我,我是新来的厨师。
答案1
我猜你不会用这个
-i IDENTITY_FILE, --identity-file IDENTITY_FILE
The SSH identity file used for authentication. Key-based authentication is recommended.
答案2
您还可以使用“ssh-agent”并在您的私钥上使用“ssh-add”来让 ssh 知道您想要使用它,而无需在调用 ssh 时指定“-i”选项。