0
我有一个主人和一个奴隶。
我可以通过SSH从主站连接到从站。
Ansible 无法连接从主机到从机的。Ansible说:“权限被拒绝(公钥,密码)”
问题:我在做什么错误,以至于无法连接,但ssh可以吗?
从主成功连接到通过ssh奴隶
[email protected]:~$ ssh slave.local
Enter passphrase for key '/home/vagrant/.ssh/id_rsa':
[email protected]'s password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
17 packages can be updated.
9 updates are security updates.
----------------------------------------------------------------
Ubuntu 16.04.3 LTS built 2017-09-08
----------------------------------------------------------------
Last login: Thu Sep 28 15:20:21 2017 from 10.0.0.10
[email protected]:~$
Ansible错误: “权限被拒绝(公钥,密码)”
[email protected]:~$ ansible all -m ping -u vagrant
The authenticity of host 'slave.local (10.0.0.11)' can't be established.
ECDSA key fingerprint is SHA256:tRGlinvTj/c2gpTayZ/mYzyWbs63s+BUX81TdKJ+0jQ.
Are you sure you want to continue connecting (yes/no)? yes
Enter passphrase for key '/home/vagrant/.ssh/id_rsa':
slave.local | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Warning: Permanently added 'slave.local' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,password).\r\n",
"unreachable": true
}
这是我的hosts文件
[email protected]:~$ cat /etc/ansible/hosts
[web]
slave.local
运行看看ssh命令有什么问题。 –
是否可以通过ssh进入[email protected]?您的手动ssh示例登录到[email protected]。 – Rickkwa
@Konstantin不幸vvvv不提供任何其他信息。但我加了 – Skip