# ping windows - ssl: the specified credentials were rejected by the serve

**URL:** <https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 26, 2017, 9:09am UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564 "2017-01-26T09:09:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Norris](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@John\_Norris](https://forum.ansible.com/u/John_Norris)\
**Post date:** [January 26, 2017, 9:09am UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/1 "2017-01-26T09:09:49Z")

</div>

Hi  
I am running ansible 2.1.2.0 on centos7. The windows machine is running windows 10 with powershell 5.  
I have installed pywinrm-0.2.2, included windows hostnames in the inventory file and also added group variables to this file for windows.  
ansible\_user=Administrator  
ansible\_password=password  
ansible\_port:=986  
ansible\_connection=winrm  
ansible\_winrm\_server\_cert\_validation=ignore  
I have also run the powershell script on the windows machine and received OK prompt.

I am doing this outside of a domain. If I ping the windows machine from centos outside of ansible I get replies. But with ansible I get

[root@centos7-ansible ~]# ansible mesh -m win\_ping -v  
Using /etc/ansible/ansible.cfg as config file  
mesh | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “ssl: the specified credentials were rejected by the server”,  
“unreachable”: true  
}

Any ideas what I am doing wrong?

Regards,  
John

---

<div class="post-metadata">

**Author:** ![johnny.sheppard.isod](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@johnny.sheppard.isod](https://forum.ansible.com/u/johnny.sheppard.isod)\
**Post date:** [January 26, 2017, 12:47pm UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/2 "2017-01-26T12:47:53Z")

</div>

Hi,

Just a quick suggestion, but the ansible\_port you’ve set is not the default. Have you changed it? If not, it should be **5986** not **986**.

Johnny 🙂

---

<div class="post-metadata">

**Author:** ![John\_Norris](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@John\_Norris](https://forum.ansible.com/u/John_Norris)\
**Post date:** [January 26, 2017, 9:24pm UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/3 "2017-01-26T21:24:22Z")

</div>

Thanks for this Johnny.  
That was typo in the message. It was

> > ansible\_port:5986
> 
> and in my hosts file ([windows:vars] I have it as

ansible\_port=5986  
but when I edited the copy and paste, I replaced :5 with = rather than just :.

So in summary, the port is right.

---

<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:** [January 27, 2017, 4:37pm UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/4 "2017-01-27T16:37:26Z")

</div>

Is the host ‘mesh’ a member of a group in your inventory file called ‘windows’?

The group needs to exist in your inventory

so assuming you inventory contains

[windows]  
mesh

and you group\_vars/windows.yml contains the connection parameters listed above?

If it isn’t then ansible will assume default connection type, which is ssh.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![John\_Norris](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@John\_Norris](https://forum.ansible.com/u/John_Norris)\
**Post date:** [January 28, 2017, 1:59pm UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/5 "2017-01-28T13:59:18Z")

</div>

I actually put the connection parameters in /etc/ansible/hosts under [windows:vars].  
Is that still valid?

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [January 28, 2017, 5:57pm UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/6 "2017-01-28T17:57:31Z")

</div>

yes, that’s still valid. Here’s a valid and working hosts file:

[all]

[all:vars]  
ansible\_connection=winrm  
ansible\_port=5986  
ansible\_winrm\_server\_cert\_validation=ignore  
ansible\_password=e6PHLue6PHLu  
ansible\_user=

[windows]  
windows1 ansible\_host=192.168.99.100

If that’s not working its likely an issue on the target server. Have you run the prepare-script?

---

<div class="post-metadata">

**Author:** ![John\_Norris](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@John\_Norris](https://forum.ansible.com/u/John_Norris)\
**Post date:** [January 30, 2017, 8:29am UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/7 "2017-01-30T08:29:46Z")

</div>

Hi Trond,  
I got it to work by changing the user from administrator.  
Many thanks for helping.  
Regards,  
john

---

<div class="post-metadata">

**Author:** ![Prajawal\_Sinhaa](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@Prajawal\_Sinhaa](https://forum.ansible.com/u/Prajawal_Sinhaa)\
**Post date:** [March 3, 2020, 10:02am UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564/8 "2020-03-03T10:02:32Z")

</div>

I am facing the same Issue. I am using basic authentication , should I use kerberos auth? I am trying to connect to my organisation’s PC.
