我想平使用以下命令我的遠程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