# Ansible ssh error - Make sure this host can be reached over ssh: Connection timed out during banner exchange

**URL:** <https://forum.ansible.com/t/ansible-ssh-error-make-sure-this-host-can-be-reached-over-ssh-connection-timed-out-during-banner-exchange/35623>\
**Category:** Ansible Project\
**Created:** [August 15, 2021, 4:20pm UTC](https://forum.ansible.com/t/ansible-ssh-error-make-sure-this-host-can-be-reached-over-ssh-connection-timed-out-during-banner-exchange/35623 "2021-08-15T16:20:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Easy\_King](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@Easy\_King](https://forum.ansible.com/u/Easy_King)\
**Post date:** [August 15, 2021, 4:20pm UTC](https://forum.ansible.com/t/ansible-ssh-error-make-sure-this-host-can-be-reached-over-ssh-connection-timed-out-during-banner-exchange/35623/1 "2021-08-15T16:20:06Z")

</div>

Below is the command to run Ansible Playbook:

ANSIBLE\_SCP\_IF\_SSH=y ansible-playbook -v -i /web/aes/admin/playbooks/PB\_BAU/ccc\_vel.hosts /web/aes/admin/playbooks/PB\_BAU/cccvel\_restart.yml -e ENV=$SH\_ENV -e ACTION=$SH\_ACTION --tags $3 -e instance\_name=$Instance  
Here is the playbook code:

- hosts: “{{ENV}}\_\*”  
user: “{{USER}}”  
gather\_facts: yes  
pre\_tasks:

- name: Check if all hosts are reachable  
fail:  
msg: \>  
[REQUIRED] ALL hosts to be reachable, so flagging {{ inventory\_hostname }} as failed,  
because host {{ item }} has no facts, meaning it is UNREACHABLE.  
when: hostvars[item].ansible\_facts is not defined  
with\_items: “{{ ansible\_play\_hosts }}”  
run\_once: true  
tags: checkserver

- debug:  
msg: “This message means all hosts are reachable”  
tags: checkserver

tasks:

- name: “Ping {{ENV}} vel Servers”  
ping:

roles:

- { role: BL, when: USER == ‘dias’ and ‘Business’ in instance\_name }  
I get Data could not be sent to remote host "server17.mybank.com". Make sure this host can be reached over ssh: Connection timed out during banner exchange\r\nConnection to 192.168.41.239 port 22 timed out\r\n error.

TASK [Check if all hosts are reachable] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[0;36mskipping: [[server17.mybank.com](http://server17.mybank.com)] =\> ([item=server17.mybank.com](http://item=server17.mybank.com)) =\> {“ansible\_loop\_var”: “item”, “changed”: false, “item”: “[server17.mybank.com](http://server17.mybank.com)”, “skip\_reason”: “Conditional result was False”}[0m

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[0;32mok: [[server17.mybank.com](http://server17.mybank.com)] =\> {[0m  
[0;32m “msg”: “This message means all hosts are reachable”[0m  
[0;32m}[0m

TASK [BL : Starting BL Services in “stg” environment] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[1;31mfatal: [[server17.mybank.com](http://server17.mybank.com)]: UNREACHABLE! =\> {“changed”: false, “msg”: “Data could not be sent to remote host "server17.mybank.com". Make sure this host can be reached over ssh: Connection timed out during banner exchange\r\nConnection to 192.168.41.239 port 22 timed out\r\n”, “unreachable”: true}[0m  
[0;33mchanged: [[server17.mybank.com](http://server17.mybank.com)] =\> {“changed”: true, “cmd”: “source ~/.profile; sh ~/startbusinesslogicservices.sh”, “delta”: “0:00:16.058674”, “end”: “2021-08-15 08:53:14.706432”, “rc”: 0, “start”: “2021-08-15 08:52:58.647758”, “stderr”: “”, “stderr\_lines”: , “stdout”: "Starting Apache… Please wait… \n\n\nApache started successfully… \nonline

…  
…  
…  
I’m using Ansible version 2.10

As you can see despite the error the role’s task seems to have triggered and the services tried to start.

Can you please suggest the exact fix for this issue please?

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [August 15, 2021, 6:52pm UTC](https://forum.ansible.com/t/ansible-ssh-error-make-sure-this-host-can-be-reached-over-ssh-connection-timed-out-during-banner-exchange/35623/2 "2021-08-15T18:52:48Z")

</div>

Can you ssh to the host with the creds you’re providing Ansible?

---

<div class="post-metadata">

**Author:** ![Easy\_King](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@Easy\_King](https://forum.ansible.com/u/Easy_King)\
**Post date:** [August 15, 2021, 8:14pm UTC](https://forum.ansible.com/t/ansible-ssh-error-make-sure-this-host-can-be-reached-over-ssh-connection-timed-out-during-banner-exchange/35623/3 "2021-08-15T20:14:55Z")

</div>

Yes, I also mentioned that the ansible command module also gets triggered on remote host. I m just concerned about the error message as it fails the playbook.

---

<div class="post-metadata">

**Author:** ![Easy\_King](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@Easy\_King](https://forum.ansible.com/u/Easy_King)\
**Post date:** [August 17, 2021, 4:07pm UTC](https://forum.ansible.com/t/ansible-ssh-error-make-sure-this-host-can-be-reached-over-ssh-connection-timed-out-during-banner-exchange/35623/4 "2021-08-17T16:07:13Z")

</div>

Why no updates on this issue. Can someone please check.
