Error saying msg SSH Error data could not be sent to the remote host Make sure this host can be reached over ssh

+1 vote

When I execute any ansible command, they appear to hit the proxy host without any issues but it fails to connect to util and monitor host.

> ansible all -a "/bin/echo hello"
util | UNREACHABLE! => {
    "changed": false, 
    "msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", 
    "unreachable": true
proxy | SUCCESS | rc=0 >>

monitor | UNREACHABLE! => {
    "changed": false, 
    "msg": "Failed to connect to the host via ssh.", 
    "unreachable": true
Feb 7, 2019 in Ansible by Alia
Hi, I am not sure about the answer but make a try:

1. Check the ping status of the remote host

2. Key copied in the remote host may be changed or it may differ

How do I check the status of the remote without sshing into it?
You could probably write a script for the same in case you don't want to use SSH.

1 answer to this question.

+1 vote

Hey @Alia, I faced a similar issue. Change your config file to something like this:

Host *
    ServerAliveInterval 60
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null
    ForwardAgent yes

####### Access to the Private Subnet Server through Proxy/bastion ########

Host proxy-server
    HostName x.x.x.x
    ForwardAgent yes

Host private-server
  HostName y.y.y.y
  ProxyCommand ssh -q proxy-server nc -q0 %h %p

Hope it help :)

answered Feb 7, 2019 by Pragya

Related Questions In Ansible

0 votes
1 answer
+1 vote
3 answers
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
1 answer

Remote host throwing error saying "Permission Denied" - Ansible

Hey @Patrick, Change the path of Ansible's remote_tmp ...READ MORE

answered Jan 16, 2019 in Ansible by Cerci
0 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP