winrm.exceptions.InvalidCredentialsError: the specified credentials were rejected by the server
See original GitHub issueHi, I tried many different approaches but still can’t login to my VM with extension:
Traceback (most recent call last):
File "fast_deploy.py", line 57, in <module>
r = win_session.run_cmd('ipconfig', ['/all'])
File "/Users/yanik/workspace/safeqa/env-deploy/lib/python3.5/site-packages/winrm/__init__.py", line 37, in run_cmd
shell_id = self.protocol.open_shell()
File "/Users/yanik/workspace/safeqa/env-deploy/lib/python3.5/site-packages/winrm/protocol.py", line 132, in open_shell
res = self.send_message(xmltodict.unparse(req))
File "/Users/yanik/workspace/safeqa/env-deploy/lib/python3.5/site-packages/winrm/protocol.py", line 207, in send_message
return self.transport.send_message(message)
File "/Users/yanik/workspace/safeqa/env-deploy/lib/python3.5/site-packages/winrm/transport.py", line 190, in send_message
raise InvalidCredentialsError("the specified credentials were rejected by the server")
winrm.exceptions.InvalidCredentialsError: the specified credentials were rejected by the server
My command is very simple:
# windows session
win_session = winrm.Session(CML_IP, auth=(r'QA13S104\administartor', '111111'))
r = win_session.run_cmd('ipconfig', ['/all'])
But I also tried different approaches, from similar issue titles, nothing is working for me.
I have permission to execute commands on the machine for this user and my winrm config:
Config
MaxEnvelopeSizekb = 500
MaxTimeoutms = 60000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = false
DefaultPorts
HTTP = 5985
HTTPS = 5986
TrustedHosts = 10.0.*
Service
RootSDDL = O:NSG:BAD:P(A;;GAGX;;;BA)(A;;GXGR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 240000
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = false
Auth
Basic = false
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint
AllowRemoteAccess = true
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 7200000
MaxConcurrentUsers = 10
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 25
MaxMemoryPerShellMB = 1024
MaxShellsPerUser = 30
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
WinRM - the specified credentials were rejected by the server
Solved it finally, it was a permission issue and not invalid credentials as pointed out in logs. There are two solutions to this...
Read more >ansible winrm : the specified credentials ... - Google Groups
"the specified credentials were rejected by the server" can often mean the password doesn't match what's expected for the user name.
Read more >ansible winrm : the specified credentials were ... - YouTube
Hello Guys, Please use below commands to solve the issue.First check the winrm config , if basic auth is false in service section...
Read more >WinRM Certificate Authentication Problem on Some 2012 ...
We have a requirement to manage some Windows servers through WinRM ... InvalidCredentialsError: the specified credentials were rejected by ...
Read more >specified credentials were rejected by the server - GeralexGR
... on a Windows machine with your active directory account you will get the error -> the specified credentials were rejected by the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
SOLVED
Not sure which config command worked, but it may be this one:
winrm set winrm/config/service @{AllowUnencrypted="true"}
(fromcmd
, notpowershell
)And now I’m able to connect and execute commands like:
Take care 😃
Please disregard the AllowUnencrypted=true, you should never do this. This library supports message encryption with ntlm, kerberos, and credssp as well as HTTPS support if you really want to use basic auth.