ERROR! plaintext: 401 Unauthorized

ubuntu@ip-172-31-9-47:~/ckp$ ansible all -m win_ping -vvv
Using /home/ubuntu/ckp/ansible.cfg as config file
<172.31.46.234> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5985 TO 172.31.46.234
172.31.46.234 | FAILED! => {
“failed”: true,
“msg”: “ERROR! plaintext: 401 Unauthorized.”
}
ubuntu@ip-172-31-9-47:~/ckp$

please help?

You are connecting over HTTP (port 5985) using basic auth. This combo does not support message encryption so everything is in plaintext and the WinRM service is rejecting it. You either need to

  • Use an auth that supports message encryption, NTLM, Kerberos or CredSSP, set ansible_winrm_transport: ntlm with the latest version of pywinrm (0.3.0) to test

  • Run over HTTPS instead of HTTP to encrypt the full traffic even with Basic auth

  • Disable the encryption check on the host (do not do this!)

Thanks

Jordan