Win32-OpenSSH
Win32-OpenSSH copied to clipboard
OpenSSH server service is not starting
Prerequisites
- [x] Write a descriptive title.
- [x] Make sure you are able to repro it on the latest version
- [x] Search the existing issues.
Steps to reproduce
After installing the OpenSSH server on Windows Server 2022, I am not able to start the service and getting the above error.
We have tried the below workaround but it didn't work.
https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__support.microsoft.com_en-2Dus_topic_december-2D10-2D2024-2Dkb5048661-2Dos-2Dbuild-2D17763-2D6659-2D68e48f87-2D3b78-2D4dd3-2Db249-2D19a47a0b4d6a%26d%3DDwMGaQ%26c%3DcCoa5WWAB7EEETJScYfkXg%26r%3DC1LfSSuQU9gUdIpesvyIC-dgoOk3dq8PHtI_bu_-SY8%26m%3DBnrcTSdeL2RDI4mwYPouslpb7N5w3n8bQrXpuhaCMTmEOxKKgDcu6WHDKsO2d6Jg%26s%3DM0OfChKBGjxIb2t6qfjbThnlP14b_MRZmuHodEkWC7M%26e%3D&data=05%7C02%7CRoshan.Kumar.Singh-extern%40hcob-bank.com%7C8162aa554c9b422e0c0f08dd469e8937%7C8fe05baef97444a492c51a20a4a10daf%7C0%7C0%7C638744368925698576%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=BSvmPnshHAWJFqCnLLdl29c0ozYzZH5DM0ntH3WzJOE%3D&reserved=0
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement
Expected behavior
The OpenSSH server service should start and ssh connection from remote machine should work properly.
Actual behavior
The OpenSSH service is failing when we are trying to start it.
Error details
PS C:\Windows\system32> Get-Service sshd
Status Name DisplayName
------ ---- -----------
Start... sshd OpenSSH SSH Server
PS C:\Windows\system32> Start-Service sshd
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
Start-Service : Failed to start service 'OpenSSH SSH Server (sshd)'.
At line:1 char:1
+ Start-Service sshd
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand
PS C:\Windows\system32> ssh -V
OpenSSH_for_Windows_9.8p1 Win32-OpenSSH-GitHub, LibreSSL 3.9.2
Environment data
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.20348.2849
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.2849
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version
OpenSSH_for_Windows_9.8p1 Win32-OpenSSH-GitHub, LibreSSL 3.9.2
Visuals
No response
@roshan9951, can you try running the ssh server in debug mode and see what the output says? sshd.exe -ddd
@tgauth, PFB the out for sshd.exe -ddd PS C:\Windows\system32> sshd.exe -ddd debug2: load_server_config: filename PROGRAMDATA\ssh/sshd_config debug2: load_server_config: done config len = 2203 debug2: parse_server_config_depth: config PROGRAMDATA\ssh/sshd_config len 2203 debug3: PROGRAMDATA\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys debug3: PROGRAMDATA\ssh/sshd_config:79 setting Subsystem sftp sftp-server.exe debug3: checking syntax for 'Match Group administrators' debug1: sshd version OpenSSH_for_Windows_9.8 Win32-OpenSSH-GitHub, LibreSSL 3.9.2 debug1: private host key #0: ssh-rsa SHA256:Zuh/ode+m1uz/Fkc6y5coSXYFdKTISf3NQp8/Mig4kc debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:ao8m/7bhzEVrWjhMc9zvT7shj6hVfE9t28hKj5Ky8ZQ debug1: private host key #2: ssh-ed25519 SHA256:dSUnWkwquxvJs0JqbGcT6gu9cEuXJVhNKtBwEjsmdYo debug1: rexec_argv[1]='-ddd' debug3: using c:\program files (x86)\openssh/sshd-session.exe for re-exec debug2: fd 7 setting O_NONBLOCK debug3: sock_set_v6only: set socket 7 IPV6_V6ONLY debug1: Bind to port 22 on ::. Server listening on :: port 22. debug2: fd 8 setting O_NONBLOCK debug1: Bind to port 22 on 0.0.0.0. Server listening on 0.0.0.0 port 22. debug3: pselect: installing signal handler for 3, previous 0033DC00 debug3: pselect: installing signal handler for 8, previous 0033DBF0 debug3: pselect_notify_setup: initializing debug2: fd 11 setting O_NONBLOCK debug2: fd 9 setting O_NONBLOCK debug3: pselect_notify_setup: pid 6660 saved 6660 pipe0 11 pipe1 9
Do you mind manually verifying the permissions for the programdata/ssh and programdata/ssh/logs folder with a screenshot (minus any personal data in the paths)? The work around you link should have done so but just to completely rule out the permissions on the folder causing this.