# Ansible win\_ping fails

**URL:** <https://forum.ansible.com/t/ansible-win-ping-fails/32069>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 27, 2020, 8:25pm UTC](https://forum.ansible.com/t/ansible-win-ping-fails/32069 "2020-01-27T20:25:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_V](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@Scott\_V](https://forum.ansible.com/u/Scott_V)\
**Post date:** [January 27, 2020, 8:25pm UTC](https://forum.ansible.com/t/ansible-win-ping-fails/32069/1 "2020-01-27T20:25:00Z")

</div>

I have OpenSSH configured on a Windows 2012 server and I can establish an SSH connection to it from Centos 7, but when I run the command:

sudo ansible windows -m win\_ping

I get:

ansible 2.9.2  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /bin/ansible  
python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]  
Using /etc/ansible/ansible.cfg as config file  
host\_list declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
script declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
auto declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
Parsed /etc/ansible/hosts inventory source with ini plugin  
META: ran handlers  
\<192.168.60.144\> ESTABLISH SSH CONNECTION FOR USER: xxxxxx  
\<192.168.60.144\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“xxxxxx”’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/b3c4c426f9 192.168.60.144 ‘/bin/sh -c ‘"’“‘echo ~xxxxxx && sleep 0’”’"‘’  
\<192.168.60.144\> (255, ‘’, ‘ **Permission denied** (publickey,password,keyboard-interactive).\r\n’)  
192.168.60.144 | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “Failed to connect to the host via ssh: Permission denied (publickey,password,keyboard-interactive).”,  
“unreachable”: true  
}

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [January 27, 2020, 9:27pm UTC](https://forum.ansible.com/t/ansible-win-ping-fails/32069/2 "2020-01-27T21:27:03Z")

</div>

Ansible just runs the ssh binary and reports back what it says. In this case it tried to authenticate using an SSH key with no fallback to password authentication and that failed. You can even run the same command that is displayed to see what happens when you run it manually. You also say you are running Ansible with sudo, why are you doing that? Do you want to use SSH key auth, or are wanting to use password auth.
