Skip to content
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

OpenSSH server service is not starting #2328

Open
3 tasks done
roshan9951 opened this issue Feb 6, 2025 · 3 comments
Open
3 tasks done

OpenSSH server service is not starting #2328

roshan9951 opened this issue Feb 6, 2025 · 3 comments

Comments

@roshan9951
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Image

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://github.com/PowerShell/Win32-OpenSSH/wiki/Security-protection-of-various-files-in-Win32-OpenSSH

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

@tgauth tgauth transferred this issue from PowerShell/openssh-portable Feb 6, 2025
@tgauth
Copy link
Collaborator

tgauth commented Feb 6, 2025

@roshan9951, can you try running the ssh server in debug mode and see what the output says? sshd.exe -ddd

@roshan9951
Copy link
Author

@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

@StevenBucher98
Copy link
Collaborator

StevenBucher98 commented Feb 10, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants