1

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?

Michael
  • 325
  • 6
  • 19
  • I also had this issue, trying to connect from my Debian Linux box to Windows servers using powershell. Yet on Windows Server 2019, `sshd` is supported. So I use the ssh client to connect, instead of powershell. You can also connect through ssh using AD domain accounts. – Krackout Apr 22 '21 at 15:54
  • Powershell >=6 is required for SSH transport which is not installed by default on Windows Server 2019. This is a problem for me. – Michael Apr 23 '21 at 10:06

0 Answers0