# Module ping: One host fails with "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh"

**URL:** <https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [July 15, 2016, 7:55am UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026 "2016-07-15T07:55:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorg\_Kastning](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jorg\_Kastning](https://forum.ansible.com/u/Jorg_Kastning)\
**Post date:** [July 15, 2016, 7:55am UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/1 "2016-07-15T07:55:01Z")

</div>

Hello there,

before executing the following commands I started a ssh-agent bash and added my private key.

Running the command “ansible all -m ping” ``checks succeeded but one. For one host I got the following error:

`host1.example.com | 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 }`

But when I run the following command in the same shell, the connection is successful:

`ssh root@host1.example.com`

The section in my inventory file looks like:

`  
[host-group]  
host[1:2].example.com  
[host-test.example.com](http://host-test.example.com)

`

Only host1 fails, the other two are checkt successfully.

I use ansible 2.1.0.0 from EPEL-Repo with RHEL 7.2.

Could someone explain to me what’s wrong here?

Kind regards,  
Joerg

---

<div class="post-metadata">

**Author:** ![alexey.vazhnov](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@alexey.vazhnov](https://forum.ansible.com/u/alexey.vazhnov)\
**Post date:** [July 19, 2016, 12:06pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/2 "2016-07-19T12:06:10Z")

</div>

Did ansible use login root for SSH connection? I think Ansible try to login with your username, not root. Use «ansible\_ssh\_user» in inventory file, or «–user» in ansible arguments, or «User» in ~/.ssh/config.

---

<div class="post-metadata">

**Author:** ![Jorg\_Kastning](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jorg\_Kastning](https://forum.ansible.com/u/Jorg_Kastning)\
**Post date:** [July 19, 2016, 1:19pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/3 "2016-07-19T13:19:42Z")

</div>

Yes, ansible use login root for SSH connection. But why should ansible try a different user? I run the command against a group of three hosts and only one fails. The three hosts are from one staging area and configured in the same way (same user, keys, packages).

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 19, 2016, 3:13pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/4 "2016-07-19T15:13:45Z")

</div>

There are many places user configuration can be done, anyway, have you tried to add -vvvv to the command to get a more verbose output?

---

<div class="post-metadata">

**Author:** ![Jorg\_Kastning](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jorg\_Kastning](https://forum.ansible.com/u/Jorg_Kastning)\
**Post date:** [July 19, 2016, 4:11pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/5 "2016-07-19T16:11:35Z")

</div>

> > Yes, ansible use login root for SSH connection. But why should ansible  
> > try  
> > a different user?
> 
> There are many places user configuration can be done, anyway, have you  
> tried to add -vvvv to the command to get a more verbose output?

&nbsp;&nbsp;&nbsp;&nbsp;\> Yes, ansible use login root for SSH connection. But why should  
ansible try  
&nbsp;&nbsp;&nbsp;&nbsp;\> a different user?

&nbsp;&nbsp;&nbsp;&nbsp;There are many places user configuration can be done, anyway, have you  
&nbsp;&nbsp;&nbsp;&nbsp;tried to add -vvvv to the command to get a more verbose output?

I did not specify a user anywhere. Whether in ssh\_config nor in  
Inventory nor with the command. Here is the output with -vvvv:

> ansible host-group -vvvv -m ping

Using /etc/ansible/ansible.cfg as config file  
Loaded callback minimal of type stdout, v2.0  
\<host1.example.com\> ESTABLISH SSH CONNECTION FOR USER: None  
\<host1.example.com\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o  
ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r host1.example.com  
'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo  
$HOME/.ansible/tmp/ansible-tmp-1468943476.87-148558126071189 `" && echo  
ansible-tmp-1468943476.87-148558126071189="` echo  
$HOME/.ansible/tmp/ansible-tmp-1468943476.87-148558126071189 `" ) &&  
sleep 0'"'"''  
\<host2.example.com\> ESTABLISH SSH CONNECTION FOR USER: None  
\<host2.example.com\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o  
ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r host2.example.com  
'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo  
$HOME/.ansible/tmp/ansible-tmp-1468943476.87-38319674786550 `" && echo  
ansible-tmp-1468943476.87-38319674786550="` echo  
$HOME/.ansible/tmp/ansible-tmp-1468943476.87-38319674786550 `" ) &&  
sleep 0'"'"''  
\<host-test.example.com\> ESTABLISH SSH CONNECTION FOR USER: None  
\<host-test.example.com\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o  
ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r host-test.example.com  
'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo  
$HOME/.ansible/tmp/ansible-tmp-1468943476.88-266972946311694 `" && echo  
ansible-tmp-1468943476.88-266972946311694="` echo  
$HOME/.ansible/tmp/ansible-tmp-1468943476.88-266972946311694 `" ) &&  
sleep 0'"'"''  
\<host1.example.com\> PUT /tmp/tmpO6LVmh TO  
/root/.ansible/tmp/ansible-tmp-1468943476.87-148558126071189/ping

\<host1.example.com\> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o  
ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[host1.example.com]'

\<host2.example.com\> PUT /tmp/tmpPCIRrD TO  
/root/.ansible/tmp/ansible-tmp-1468943476.87-38319674786550/ping

\<host2.example.com\> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o  
ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[host2.example.com]'

\<host-test.example.com\> PUT /tmp/tmp2vmkei TO  
/root/.ansible/tmp/ansible-tmp-1468943476.88-266972946311694/ping

\<host-test.example.com\> SSH: EXEC sftp -b - -C -vvv -o  
ControlMaster=auto -o ControlPersist=60s -o  
KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r  
'[host-test.example.com]'  
host1.example.com | UNREACHABLE! =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "SSH Error: data could not be sent to the remote host. Make  
sure this host can be reached over ssh",  
&nbsp;&nbsp;&nbsp;&nbsp;"unreachable": true  
}  
\<host2.example.com\> ESTABLISH SSH CONNECTION FOR USER: None  
\<host2.example.com\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o  
ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt host2.example.com  
'/bin/sh -c '"'"'LANG=de\_DE.UTF-8 LC\_ALL=de\_DE.UTF-8  
LC\_MESSAGES=de\_DE.UTF-8 /usr/bin/python  
/root/.ansible/tmp/ansible-tmp-1468943476.87-38319674786550/ping; rm -rf  
"/root/.ansible/tmp/ansible-tmp-1468943476.87-38319674786550/" \>  
/dev/null 2\>&1 && sleep 0'"'"''  
\<host-test.example.com\> ESTABLISH SSH CONNECTION FOR USER: None  
\<host-test.example.com\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o  
ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
PasswordAuthentication=no -o ConnectTimeout=10 -o  
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt  
host-test.example.com '/bin/sh -c '"'"'LANG=de\_DE.UTF-8  
LC\_ALL=de\_DE.UTF-8 LC\_MESSAGES=de\_DE.UTF-8 /usr/bin/python  
/root/.ansible/tmp/ansible-tmp-1468943476.88-266972946311694/ping; rm  
-rf "/root/.ansible/tmp/ansible-tmp-1468943476.88-266972946311694/" \>  
/dev/null 2\>&1 && sleep 0'"'"''  
host2.example.com | SUCCESS =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"invocation": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"module\_args": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"data": null  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"module\_name": "ping"  
&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;"ping": "pong"  
}  
host-test.example.com | SUCCESS =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"invocation": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"module\_args": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"data": null  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"module\_name": "ping"  
&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;"ping": "pong"  
}  
[2016.07.19 17:51:17] ~/ansible

I'm somewhat curious about the following line:  
ESTABLISH SSH CONNECTION FOR USER: None

I would expect ansible to establish a connection for root. Shouldn't  
that be the default behaviour?

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [July 19, 2016, 5:19pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/6 "2016-07-19T17:19:31Z")

</div>

No, there isn't a default behaviour. You need to tell it what user to use  
(set ansible\_ssh\_user somewhere).

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 19, 2016, 5:40pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/7 "2016-07-19T17:40:07Z")

</div>

Actually it is, it will use the same user as you are logged in as on the Ansible Control Machine.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 19, 2016, 5:55pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/8 "2016-07-19T17:55:56Z")

</div>

> \<host1.example.com\> ESTABLISH SSH CONNECTION FOR USER: None  
> \<host1.example.com\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o  
> ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
> PasswordAuthentication=no -o ConnectTimeout=10 -o  
> ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r host1.example.com  
> '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo  
> $HOME/.ansible/tmp/ansible-tmp-1468943476.87-148558126071189 `" && echo  
> ansible-tmp-1468943476.87-148558126071189="` echo  
> $HOME/.ansible/tmp/ansible-tmp-1468943476.87-148558126071189 `" ) &&  
> sleep 0'"'"''

Here Ansible is doing the ssh and setting up the run.  
Since it doesn't fail here, the ssh is working.

> \<host1.example.com\> PUT /tmp/tmpO6LVmh TO  
> /root/.ansible/tmp/ansible-tmp-1468943476.87-148558126071189/ping  
> \<host1.example.com\> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o  
> ControlPersist=60s -o KbdInteractiveAuthentication=no -o  
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o  
> PasswordAuthentication=no -o ConnectTimeout=10 -o  
> ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[host1.example.com]'
> 
> host1.example.com | UNREACHABLE! =\> {  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"msg": "SSH Error: data could not be sent to the remote host. Make  
> sure this host can be reached over ssh",  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"unreachable": true  
> }

But when Ansible tries to copy over the files it need to run the ping command it fails, so something is denying sftp to host1.

You could check that ssh is working with the raw module like this:  
ansible test1.example.com -m raw -a "hostname"

> I'm somewhat curious about the following line:  
> ESTABLISH SSH CONNECTION FOR USER: None

I guess this means that no user is set in Ansible, and that the logged in user is being used.

> I would expect ansible to establish a connection for root. Shouldn't  
> that be the default behaviour?

The default behavior is the user you are logged in as.

---

<div class="post-metadata">

**Author:** ![rup](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@rup](https://forum.ansible.com/u/rup)\
**Post date:** [July 19, 2016, 6:16pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/9 "2016-07-19T18:16:52Z")

</div>

We also have a similar issue when the ssh times out. We’ve been having that occur occasionally lately, randomly to servers, and are considering setting up a config file to override the 10 second timeout default. Just a thought anyway.

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [July 19, 2016, 6:16pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/10 "2016-07-19T18:16:53Z")

</div>

Sorry Kai, you're quite right.

---

<div class="post-metadata">

**Author:** ![Werner\_Flamme](https://avatars.discourse-cdn.com/v4/letter/w/c68b51/32.png) [@Werner\_Flamme](https://forum.ansible.com/u/Werner_Flamme)\
**Post date:** [July 20, 2016, 7:16am UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/11 "2016-07-20T07:16:05Z")

</div>

Kai Stian Olstad [19.07.2016 19:55]:

---

<div class="post-metadata">

**Author:** ![Jorg\_Kastning](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jorg\_Kastning](https://forum.ansible.com/u/Jorg_Kastning)\
**Post date:** [July 20, 2016, 1:11pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/12 "2016-07-20T13:11:29Z")

</div>

Hi,

At first, thank you all for your help. 🙂

When I run the command Kai Stian Olstad suggested I got the following:

`  
ansible [host1.example.com](http://host1.example.com) -m raw -a “hostname”  
[host1.example.com](http://host1.example.com) | SUCCESS | rc=0 \>\>  
host1

`

---

<div class="post-metadata">

**Author:** ![jorge.iglesias.contr](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jorge.iglesias.contr](https://forum.ansible.com/u/jorge.iglesias.contr)\
**Post date:** [March 6, 2017, 9:21am UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/13 "2017-03-06T09:21:06Z")

</div>

Hi!  
I have the same problem but i don´t know the solution.

ssh found, scp found, but the ping said that “ERROR! SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh”

This is the output of ansible -vvvv all -m ping:

`  
Loaded callback minimal of type stdout, v2.0  
\<192.168.69.190\> ESTABLISH SSH CONNECTION FOR USER: None  
\<192.168.69.190\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.69.190 ‘( umask 22 && mkdir -p “$( echo $HOME/.ansible/tmp/ansible-tmp-1488791696.73-239421557112032 )” && echo “$( echo $HOME/.ansible/tmp/ansible-tmp-1488791696.73-239421557112032 )” )’  
\<192.168.69.104\> ESTABLISH SSH CONNECTION FOR USER: None  
\<192.168.69.104\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.69.104 ‘( umask 22 && mkdir -p “$( echo $HOME/.ansible/tmp/ansible-tmp-1488791696.74-88043441209635 )” && echo “$( echo $HOME/.ansible/tmp/ansible-tmp-1488791696.74-88043441209635 )” )’  
\<192.168.69.190\> PUT /tmp/tmpuh7eyZ TO /root/.ansible/tmp/ansible-tmp-1488791696.73-239421557112032/ping  
\<192.168.69.190\> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r ‘[192.168.69.190]’  
\<192.168.69.190\> ESTABLISH SSH CONNECTION FOR USER: None  
\<192.168.69.190\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.69.190 ‘LANG=en\_US.UTF-8 LC\_ALL=en\_US.UTF-8 LC\_MESSAGES=en\_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1488791696.73-239421557112032/ping; rm -rf “/root/.ansible/tmp/ansible-tmp-1488791696.73-239421557112032/” \> /dev/null 2\>&1’  
192.168.69.190 | SUCCESS =\> {  
“changed”: false,  
“invocation”: {  
“module\_args”: {  
“data”: null  
},  
“module\_name”: “ping”  
},  
“ping”: “pong”  
}  
\<192.168.69.104\> PUT /tmp/tmpfmBWoS TO /root/.ansible/tmp/ansible-tmp-1488791696.74-88043441209635/ping  
\<192.168.69.104\> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r ‘[192.168.69.104]’  
192.168.69.104 | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “ERROR! SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh”,  
“unreachable”: true  
}

`

TY!

Jorge

---

<div class="post-metadata">

**Author:** ![Jorg\_Kastning](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jorg\_Kastning](https://forum.ansible.com/u/Jorg_Kastning)\
**Post date:** [March 22, 2017, 10:19am UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/14 "2017-03-22T10:19:40Z")

</div>

Hi,

cloud you conncet to the host using ssh from a terminal without using the ansible module? Have you checked that the subsystem sftp line in /etc/ssh/sshd\_config on your host points to an existent sftp-server binary?

Regards,  
Joerg

---

<div class="post-metadata">

**Author:** ![balubhai555](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@balubhai555](https://forum.ansible.com/u/balubhai555)\
**Post date:** [March 28, 2017, 7:04pm UTC](https://forum.ansible.com/t/module-ping-one-host-fails-with-ssh-error-data-could-not-be-sent-to-the-remote-host-make-sure-this-host-can-be-reached-over-ssh/22026/15 "2017-03-28T19:04:54Z")

</div>

> Hello,Jorg,

> I got the same error. At the time, I did the below and then ssh connection got success and data successfully sent thru the ssh to remote host.

In ansible Control machine execute these commands.

\*\*root\>ssh-add //\*\*it adds the identity files to ssh-agent …i.e add the ~/.ssh/id\_rsa.pub file ssh-agent

**root\>eval “$(ssh-agent)” //** after that will start the ssh-agent to start the ssh connection and execute this for refreshment of hosts…

**root\>**" **ansible all -m ping -c ssh -u \<\>"**

then the error resolved.

Thank you.
