# Getting SSH server unreachable error when executing ansible scripts

**URL:** <https://forum.ansible.com/t/getting-ssh-server-unreachable-error-when-executing-ansible-scripts/43533>\
**Category:** Get Help\
**Tags:** ubuntu\
**Created:** [June 24, 2025, 2:31pm UTC](https://forum.ansible.com/t/getting-ssh-server-unreachable-error-when-executing-ansible-scripts/43533 "2025-06-24T14:31:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashaya](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Ashaya](https://forum.ansible.com/u/Ashaya)\
**Post date:** [June 24, 2025, 2:31pm UTC](https://forum.ansible.com/t/getting-ssh-server-unreachable-error-when-executing-ansible-scripts/43533/1 "2025-06-24T14:31:56Z")

</div>

Hi Team, I’m running an Ansible playbook with Python 3.8.23 and Ansible 2.9.27 to maintain compatibility with some existing scripts. When executing the playbook, I’m encountering the following SSH error:

fatal: [[host-alias.domain.example.com](http://host-alias.domain.example.com)]: UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “Failed to connect to the host via ssh: OpenSSH\_9.6p1 Ubuntu-3ubuntu3.12, OpenSSL 3.0.13 30 Jan 2024\r  
debug1: Reading configuration data /home/user/.ssh/config\r  
debug1: /home/user/.ssh/config line 10: Applying options for [domain.example.com](http://domain.example.com)\r  
debug1: Reading configuration data /etc/ssh/ssh\_config\r  
debug1: /etc/ssh/ssh\_config line 21: include /etc/ssh/ssh\_config.d/\*.conf matched no files\r  
debug1: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts2’ → ‘/home/user/.ssh/known\_hosts2’\r  
debug1: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts’ → ‘/home/user/.ssh/known\_hosts’\r  
debug1: identity file /home/user/.ssh/id\_privx type -1\r  
debug1: identity file /home/user/.ssh/id\_privx-cert type -1\r  
debug1: Local version string SSH-2.0-OpenSSH\_9.6p1 Ubuntu-3ubuntu3.12\r  
debug1: Connection timed out during banner exchange\r  
kex\_exchange\_identification: Connection to UNKNOWN port 65535 timed out\r”,  
“unreachable”: true  
}

- Manual SSH works fine using `privx-cmd.exe`
- The same server is reachable via `ping’
- SSH config points to `privx-cmd` proxy command.
- Problem occurs only during ansible playbook execution

How can I resolve the SSH `UNREACHABLE` error when using Ansible with PrivX proxy-based SSH while manual SSH works fine?

Any pointers or experiences appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [June 24, 2025, 3:23pm UTC](https://forum.ansible.com/t/getting-ssh-server-unreachable-error-when-executing-ansible-scripts/43533/2 "2025-06-24T15:23:26Z")

</div>

full output of the the task with `-vvv` would help, it will show the actual ssh command ansible is running and you can probably see what the issue is there.
