-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with WinRM connection if the host requires first time login password change #103
Comments
Hi @Dineshk77 , Thanks for reporting this issue. Unfortunately I don't think you'll be able to solve this issue by reading stdout/stdin. I'm not sure, but I believe that this password change is part of the authentication negotiation in NTLM. Can you try another winrm client implementation (ie the ruby one for instance) to check that it is indeed an issue in this project? But I think it would be easier for your use-case to use certificate authentication and not rely on passwords at all. See https://www.hurryupandwait.io/blog/certificate-password-less-based-authentication-in-winrm for more information. |
Hi @masterzen I tried with one of the ruby project -https://github.com/WinRb/WinRM I couldn't make a successful connection using the user account which requires password rest. However I was able to connect with another domain account with the below code and it worked.
However I can't do the same using below winrm Golang code. Am I missing something?
Error states: http response error: 401 - invalid content type |
The HTTP error 401 means that the winrm server didn't authorize the request. Unfortunately this is hard to troubleshoot. |
I am trying to establish winrm connection to the host which has a first time login password change requirement. Is there an option to stdin when the host requests password change?. I am using the below code structure and fails during createShelll() call stating unknown error Post "http://host_ip:5986/wsman": net/http: timeout awaiting response headers
The host has the below winrm setting and winrm connection works fine (ex: using terraform) for the same host with different user - the user does not require password change.
I can achieve the password change for unix systems by reading the stdout and stdin using golang.org/x/crypto/ssh. Checking if there is something similar I can do with winrm.
The text was updated successfully, but these errors were encountered: