OpenSSH BUG - Can't SSH when running "sshd" as a "Service" - Can when "sshd" is run from the cmd line

Veljko Cankovic 6 Reputation points
2021-11-29T09:28:16.27+00:00

I want to ask if you are familiar of some version of the OpenSSH server that can be installed in Windows which does not have active following issue:

if "sshd.exe" OpenSSH server process is being run as a Service then we cannot SSH from the remote server. Getting the error: "sshd: error: lookup_principal_name: User principal name lookup failed for user 'domain\userx'"
if we run "sshd.exe" process manually with C:\Program Files\OpenSSH-Win64> .\sshd.exe -ddd then in that case we can ssh successfully.

This kind of issue was mentioned earlier in the github link https://github.com/PowerShell/Win32-OpenSSH/issues/1177

same behaviour is mentioned there as well:

If I started with sshd.exe -d, I can connect with public key authentication. However, if I started it as service by PowerSell: Start-Service sshd, my connection will be reset

I had to download and install OpenSSH server from this link. https://github.com/PowerShell/Win32-OpenSSH/releases I've used the latest version: V8.6.0.0p1-Beta and I am surprised that the issue which appeared a several years ago is still active!!!

Does anyone know of a version which does not have this issue which I will be able to download from the github? I am aware of the issue, I know what's the workaround but I would need stable version that I can use?

Hope that someone did face the same issue and has a solution...

Thank you!

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,260 questions
0 comments No comments
{count} vote