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

Modify sshd_config to match Linux when enabling OpenSSH Server #3145

Open
3 tasks done
RuiNtD opened this issue Jan 3, 2025 · 0 comments
Open
3 tasks done

Modify sshd_config to match Linux when enabling OpenSSH Server #3145

RuiNtD opened this issue Jan 3, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@RuiNtD
Copy link

RuiNtD commented Jan 3, 2025

Is your feature request related to a problem? Please describe

Windows adds the following lines to sshd_config:

Match Group administrators
       AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

These lines make it so admins have to put their SSH keys in %ProgramData%\ssh\administrators_authorized_keys and causes %UserProfile%\.ssh\authorized_keys to be completely ignored. This is intentional behavior according to Microsoft docs, but it causes a lot of confusion and frustration since it's inconsistent with OpenSSH Server on Linux.

Describe the solution you'd like

When the user uses the "Enable OpenSSH Server" button, WU should remove or comment out the lines above at the end of sshd_config.

Describe alternatives you've considered

Update the output in WU's console when enabling OpenSSH Server to mention this behavior. Currently, it just says:

Add your public keys to this file -> C:\\Users\USERNAME\.ssh\authorized_keys

Which doesn't even work for admins.

Additional context

Issue validation

  • I checked for duplicate issues.
  • I checked for already existing discussions.
  • I checked for an already existing pull request addressing the issue.
@RuiNtD RuiNtD added the enhancement New feature or request label Jan 3, 2025
@RuiNtD RuiNtD changed the title Modify sshd_config to match Linux behavior for keys Modify sshd_config to match Linux when enabling OpenSSH Server Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant