I want to open a Powershell session from CentOS 7 to a Windows Server 2019 using a domain account but I can't get it working.
What I've done so far:
- Enabled WinRM on Windows (verified connection from another Windows Server 2019)
- Installed Powershell 7.1.3 on CentOS
- Installed gssntlmssp to enable NTLM authentication
Connection is done like this:
$sesopt = New-PSSessionOption -SkipCACheck -SkipCNCheck
Enter-PSSession -ComputerName 192.168.10.85 -Credential $cred -Authentication Negotiate -UseSSL -SessionOption $sesopt
gives me the error:
Enter-PSSession: Connecting to remote server 192.168.10.85 failed with the following error message : Authorization failed For more information, see the about_Remote_Troubleshooting Help topic.
On Windows eventlog I can see a authentication error with error code 0xC000035B. It looks like Powershell on Linux is trying NTLMv1 which is unsupported on modern Windows Server I think.
How to get a Powershell session working from CentOS 7 to Windows Server 2019 using WinRM and a domain account?