# cannot run win\_ping. receiving "ssl: the specified credentials were rejected by the server"

**URL:** <https://forum.ansible.com/t/cannot-run-win-ping-receiving-ssl-the-specified-credentials-were-rejected-by-the-server/24484>\
**Category:** Ansible Project\
**Tags:** azure, windows, ubuntu\
**Created:** [May 15, 2017, 9:50am UTC](https://forum.ansible.com/t/cannot-run-win-ping-receiving-ssl-the-specified-credentials-were-rejected-by-the-server/24484 "2017-05-15T09:50:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo\_Y](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Leo\_Y](https://forum.ansible.com/u/Leo_Y)\
**Post date:** [May 15, 2017, 9:50am UTC](https://forum.ansible.com/t/cannot-run-win-ping-receiving-ssl-the-specified-credentials-were-rejected-by-the-server/24484/1 "2017-05-15T09:50:50Z")

</div>

Hello,

I try to setup a simple Ansible inventory for Windows server using basic authentication. Both my machines are in Azure. Windows server is not in domain and has a user who is a member in Administrators and Remote Management groups.  
HTTPS between machines work:

> $ nc -z -w1 [test1.eastus.cloudapp.azure.com](http://test1.eastus.cloudapp.azure.com) 5986;echo $?  
> 0

However, when I try a simple ping command it fails:

> $ ansible windows -i hosts -m win\_ping -vvvvv
> 
> Using /etc/ansible/ansible.cfg as config file
> 
> Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/ **init**.pyc
> 
> META: ran handlers
> 
> Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/win\_ping.ps1
> 
> \<[vm-server1.eastus.cloudapp.azure.com](http://vm-server1.eastus.cloudapp.azure.com)\> ESTABLISH WINRM CONNECTION FOR USER: .\medcon on PORT 5986 TO [vm-server1.eastus.cloudapp.azure.com](http://vm-server1.eastus.cloudapp.azure.com)
> 
> \<[vm-server1.eastus.cloudapp.azure.com](http://vm-server1.eastus.cloudapp.azure.com)\> WINRM CONNECT: transport=ssl endpoint=[https://vm-server1.eastus.cloudapp.azure.com:5986/wsman](https://vm-server1.eastus.cloudapp.azure.com:5986/wsman)
> 
> \<[vm-server1.eastus.cloudapp.azure.com](http://vm-server1.eastus.cloudapp.azure.com)\> WINRM CONNECTION ERROR: the specified credentials were rejected by the server
> 
> Traceback (most recent call last):
> 
> File “/usr/lib/python2.7/dist-packages/ansible/plugins/connection/winrm.py”, line 214, in \_winrm\_connect
> 
> self.shell\_id = protocol.open\_shell(codepage=65001) # UTF-8
> 
> File “/usr/local/lib/python2.7/dist-packages/winrm/protocol.py”, line 132, in open\_shell
> 
> res = self.send\_message(xmltodict.unparse(req))
> 
> File “/usr/local/lib/python2.7/dist-packages/winrm/protocol.py”, line 207, in send\_message
> 
> return self.transport.send\_message(message)
> 
> File “/usr/local/lib/python2.7/dist-packages/winrm/transport.py”, line 198, in send\_message
> 
> raise InvalidCredentialsError(“the specified credentials were rejected by the server”)
> 
> InvalidCredentialsError: the specified credentials were rejected by the server
> 
> [vm-server1.eastus.cloudapp.azure.com](http://vm-server1.eastus.cloudapp.azure.com) | UNREACHABLE! =\> {
> 
> “changed”: false,
> 
> “msg”: “ssl: the specified credentials were rejected by the server”,
> 
> “unreachable”: true
> 
> }

I looked into a lot of posts in this group, github and on inet and found nothing that could help.

My inventory (hosts) file:

> $ cat hosts
> 
> [windows]
> 
> [test1.eastus.cloudapp.azure.com](http://test1.eastus.cloudapp.azure.com)
> 
> [windows:vars]
> 
> ansible\_user=.\test
> 
> ansible\_password=secret\_password
> 
> ansible\_port=5986
> 
> ansible\_connection=winrm
> 
> ansible\_winrm\_server\_cert\_validation=ignore

Needless to say that the credentials work when I RDP to the machine.

Other relevant information about machines

Ansible control machine:

> **$ lsb\_release -a**

> No LSB modules are available.
> 
> Distributor ID: Ubuntu
> 
> Description: Ubuntu 16.04.2 LTS
> 
> Release: 16.04
> 
> Codename: xenial

> **$ ansible --version**
> 
> ansible 2.3.0.0
> 
> config file = /etc/ansible/ansible.cfg
> 
> configured module search path = Default w/o overrides
> 
> python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

Windows server machine:

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [May 15, 2017, 1:23pm UTC](https://forum.ansible.com/t/cannot-run-win-ping-receiving-ssl-the-specified-credentials-were-rejected-by-the-server/24484/2 "2017-05-15T13:23:11Z")

</div>

ansible\_user=.\test

is an unusual looking username.

Also it looks like you are connecting is ‘.\medcon’ when you run ansible command.

“the specified credentials were rejected by the server” usually means that the supplied username and password don’t match what windows is expecting.

Could you try again without the .\ at the beginning of the user name?

ansible\_user=test

Hope this helps,

Jon
