我想平使用以下命令我的远程Linux机器:无法通过Ansible
ansible remote -m ping -vvvv
我得到如下回应:
[[email protected] ansible]# ansible remote -m ping -vvvv
Using /etc/ansible/ansible.cfg as config file
Loaded callback minimal of type stdout, v2.0
<192.41.50.9> ESTABLISH SSH CONNECTION FOR USER: root
<192.41.50.9> SSH: EXEC sshpass -d12 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o Port=22 -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 192.41.50.9 '/bin/sh -c '"'"'(umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1480431200.39-212981181831507 `" && echo ansible-tmp-1480431200.39-212981181831507="` echo $HOME/.ansible/tmp/ansible-tmp-1480431200.39-212981181831507 `") && sleep 0'"'"''
192.41.50.9 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh.",
"unreachable": true
}
我hosts文件是这样的:
[remote]
192.41.50.9
[remote:vars]
ansible_ssh_user=root
[email protected]
ansible_ssh_port=22
当我想ssh到我的远程计算机,这是我的了:
[[email protected] ansible]# ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
86:d2:ca:8e:aa:8a:ce:25:c7:e5:31:7e:2a:c0:11:7f.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:3
RSA host key for 192.41.50.9 has changed and you have requested strict checking.
Host key verification failed.
什么可能是这个连接失败的原因是什么?
你可以运行'ansible remote -m ping -vvvv'并粘贴结果吗? – user2599522
当我输入*** ansible remote -m ping -vvvv ***时,我改变了我的问题并显示了回应。请检查一下。谢谢。 – prudhvi
你能从终端上ssh root @ 192.41.50.9'吗? – user2599522