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

Cannot restart sshd service after gaining access to log folder #2335

Closed
3 tasks done
hongshu-w opened this issue Mar 3, 2025 · 1 comment
Closed
3 tasks done

Cannot restart sshd service after gaining access to log folder #2335

hongshu-w opened this issue Mar 3, 2025 · 1 comment

Comments

@hongshu-w
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

Hi team,
We are facing an issue where the sshd service cannot be restarted after a user, other than the built-in administrator, gains write access to the log folder located under ProgramData\ssh.

Steps to Reproduce:

Navigate to the ProgramData\ssh folder.
A user (not the built-in administrator) attempts to gain write access to the log folder by clicking on it and selecting "Continue" to gain access.

Image

Attempt to restart the sshd service.

Image

Expected Result: The sshd service should restart successfully.

Actual Result: The sshd service fails to restart, even though the sshd executable works correctly.

Additional Information:
This issue is easily reproducible as any user can gain write access to the log folder by simply clicking on it and selecting "Continue".

Expected behavior

Can restart sshd service

Actual behavior

Restart-Service : Failed to start service 'OpenSSH SSH Server (sshd)'.

Error details

Restart-Service : Failed to start service 'OpenSSH SSH Server (sshd)'.
At line:1 char:1
+ Restart-Service sshd
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Restart-Service]
   , ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.RestartServiceCommand

Environment data

PS C:\Windows\system32> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.26100.10034
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.10034
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

Visuals

No response

@tgauth
Copy link
Collaborator

tgauth commented Mar 3, 2025

Please see #2290 (comment) for a workaround.

This behavior was changed in PowerShell/openssh-portable#761 which will be included in a future release.

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

No branches or pull requests

3 participants