failing to connect through ssh

495 views
Skip to first unread message

gcpco...@gmail.com

unread,
Aug 21, 2017, 11:54:31 AM8/21/17
to Ansible Project
I used the below example to execute from GIT

I am getting the following error:

fatal: [35.184.19.164]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\r\nIt is also possible that a host key has just been changed.\r\nThe fingerprint for the ECDSA key sent by the remote host is\n05:88:4d:7f:50:ec:21:38:12:d9:b8:0f:b1:29:0c:33.\r\nPlease contact your system administrator.\r\nAdd correct host key in /root/.ssh/known_hosts to get rid of this message.\r\nOffending ECDSA key in /root/.ssh/known_hosts:17\r\nChallenge/response authentication is disabled to avoid man-in-the-middle attacks.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
fatal: [35.202.50.199]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\r\nIt is also possible that a host key has just been changed.\r\nThe fingerprint for the ECDSA key sent by the remote host is\n23:8a:d0:e0:50:be:97:9a:c7:64:c1:24:b1:f2:42:1f.\r\nPlease contact your system administrator.\r\nAdd correct host key in /root/.ssh/known_hosts to get rid of this message.\r\nOffending ECDSA key in /root/.ssh/known_hosts:13\r\nChallenge/response authentication is disabled to avoid man-in-the-middle attacks.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
fatal: [35.193.161.39]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\r\nIt is also possible that a host key has just been changed.\r\nThe fingerprint for the ECDSA key sent by the remote host is\nc1:65:32:ac:b6:97:a9:ec:55:38:ba:ac:49:1e:5e:6e.\r\nPlease contact your system administrator.\r\nAdd correct host key in /root/.ssh/known_hosts to get rid of this message.\r\nOffending ECDSA key in /root/.ssh/known_hosts:12\r\nChallenge/response authentication is disabled to avoid man-in-the-middle attacks.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
        to retry, use: --limit @/home/gcpconsole/compute-ansible-gluster/gluster.retry

PLAY RECAP ************************************************************************************************************
127.0.0.1                  : ok=7    changed=6    unreachable=0    failed=0   
35.184.19.164              : ok=0    changed=0    unreachable=1    failed=0   
35.193.161.39              : ok=0    changed=0    unreachable=1    failed=0   
35.202.232.100             : ok=0    changed=0    unreachable=1    failed=0   
35.202.50.199              : ok=0    changed=0    unreachable=1    failed=0  

***********************************************************************************************************************************************
I have added all the necessary key in the GCP console....


Please help me soving this

Dick Visser

unread,
Aug 21, 2017, 11:47:37 PM8/21/17
to ansible...@googlegroups.com
Hi

As the errors state this is a problem with how the SSH keys are set-up.
The github URL has quite elaborate documentation (as usual with Google tools), and it includes a URL to an even more elaborate page specifically for setting up SSH keys (for completeness: https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys?hl=en).
Check those steps again.

One hint could be that apparently you're running this playbook as root. 
Could it be that you've set up SSH keys in a different/your account, but that you are running the playbook with 'sudo'? That would explain things.
If that's the case: don't do that. Run the playbook as the user that you've setup SSH keys for.

Dick 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e2f709d9-2625-4636-b276-c48a90bb240a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Dick Visser
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

chandana gcp

unread,
Aug 22, 2017, 2:34:38 AM8/22/17
to ansible...@googlegroups.com
Hi Dick

Thanks a lot for your reply Dick..... I tied the same steps as you have suggested in the link, still the error is coming and i have also tried running the playbook as user rather than root, but still error is coming.

TASK [Gathering Facts] *****************************************************************************************
fatal: [35.202.234.156]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.202.234.156' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
fatal: [35.202.50.199]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.202.50.199' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
fatal: [35.202.232.100]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.202.232.100' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
fatal: [35.184.19.164]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.184.19.164' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
 [WARNING]: Could not create retry file '/home/gcpconsole/compute-ansible-gluster/gluster.retry'.
[Errno 13] Permission denied: u'/home/gcpconsole/compute-ansible-gluster/gluster.retry'


PLAY RECAP *****************************************************************************************************
127.0.0.1                  : ok=7    changed=6    unreachable=0    failed=0   
35.184.19.164              : ok=0    changed=0    unreachable=1    failed=0   
35.202.232.100             : ok=0    changed=0    unreachable=1    failed=0   
35.202.234.156             : ok=0    changed=0    unreachable=1    failed=0   
35.202.50.199              : ok=0    changed=0    unreachable=1    failed=0   
:-( 

Thanks in advance
chandana


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
--
Dick Visser
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/PvvglMhGfWg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwN5YgYv6Q836%3DKmLbVfjf7-9UfhuPNAOaY1o%3DofPombng%40mail.gmail.com.

Dick Visser

unread,
Aug 22, 2017, 5:25:32 AM8/22/17
to ansible...@googlegroups.com
Hi



On 22 August 2017 at 08:34, chandana gcp <gcpco...@gmail.com> wrote:
>
> Hi Dick
>
> Thanks a lot for your reply Dick..... I tied the same steps as you have suggested in the link, still the error is coming and i have also tried running the playbook as user rather than root, but still error is coming.


Actually, it is a different error, and also a warning (at the end).
To fix one thing at a time - can you make sure the permissions are
fixed, and then run the playbook again?


Dick


>
> TASK [Gathering Facts] *****************************************************************************************
> fatal: [35.202.234.156]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.202.234.156' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
> fatal: [35.202.50.199]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.202.50.199' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
> fatal: [35.202.232.100]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.202.232.100' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
> fatal: [35.184.19.164]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '35.184.19.164' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n", "unreachable": true}
> [WARNING]: Could not create retry file '/home/gcpconsole/compute-ansible-gluster/gluster.retry'.
> [Errno 13] Permission denied: u'/home/gcpconsole/compute-ansible-gluster/gluster.retry'
>







Reply all
Reply to author
Forward
0 new messages