Commit Graph
5 Commits
Author SHA1 Message Date
AshvinandGitHub 9fdadd1c8f Point OpenSSH key setup at the file sshd actually reads (#4936)
* Point OpenSSH key setup at the file sshd actually reads

The Remote Access feature created %USERPROFILE%\.ssh\authorized_keys and
told the user to put their public keys there. sshd does not read that
file for a member of the administrators group; the "Match Group
administrators" block in sshd_config sends those logons to
C:\ProgramData\ssh\administrators_authorized_keys instead. WinUtil always
relaunches itself elevated, so the account it was setting up is always an
administrator, and key auth for it never worked.

The function tried to work around that by commenting the block out, but
those regexes anchor on $, and .NET puts $ before the \n of a CRLF pair.
The sshd_config Windows ships is CRLF throughout, so the replace was a
silent no-op on a stock install. On an sshd_config with LF endings it did
apply, and that is worse than not working: sshd gives an administrator
logon a full token with no UAC prompt, which is why Windows keeps those
keys in ProgramData behind an ACL that requires elevation to write.
Moving the lookup into the profile lets anything running as the user at
medium integrity append a key and get an elevated shell unprompted.

Use administrators_authorized_keys and give it the ACL sshd requires
(inheritance off, Administrators and SYSTEM only, by SID so localized
installs work). Where the sshd_config edit did land, undo it and copy any
keys out of the profile file first so key auth is not cut off mid-session.
Keys are only copied when the block needs restoring, so a default config
never grants access sshd was not already granting.

Also stop creating the profile .ssh directory: under elevation it was the
elevating administrator's profile, not necessarily the caller's.

* Document where to put SSH keys for the OpenSSH server feature
2026-08-09 13:08:33 -05:00
Paweł GwozdowskiandGitHub aefbf1a847 standardize console message punctuation and capitalization (#4680) 2026-06-22 14:17:23 -05:00
GabiandGitHub 24c6706ab2 Update Invoke-WinUtilSSHServer.ps1 (#4254)
* Update Invoke-WinUtilSSHServer.ps1

* fix: correct ssh-agent restart, use USERPROFILE path, add sshd_config idempotency check

* Cleanup for Invoke-WinUtilSSHServer.ps1

* Update Invoke-WinUtilSSHServer.ps1

* Merge branch 'ChrisTitusTech:main' into patch-2

* Update Invoke-WinUtilSSHServer.ps1

* Update Invoke-WinUtilSSHServer.ps1

* Merge branch 'main' into patch-2

* Update Invoke-WinUtilSSHServer.ps1

* typo
2026-03-27 08:26:36 -05:00
0028e439b5 Cleaned up typos, fixes grammatical errors and other related fixes (#4215)
* cleaned up typo, fixes, grammatical and other related fixes (#2)

* typo in Lightshot app name

* remove trailing comma in applications.json

* consistent capitalization of Windows, WinGet - only user-facing text

	- includes update to devdocs-generator.ps1, so docs for tweaks modifying registry will have `Windows settings` rather than `windows settings`

* various fixes for typos, style, punctuation and capitalization

* capitalize 'AM'

* Update README.md

change formatting for GitHub UI interaction form code format (` `) to bold md

Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com>

* typos and wording in docs

---------

Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com>
2026-03-26 15:26:21 -05:00
Saksham SinghandGitHub f012064574 SSH server option (#2745)
* Squashed commit of the following:

commit c674d5eb605b549d8d8b247749954a98197277b4
Author: Saksham Singh <sakshamsingh.93502@gmail.com>
Date:   Wed Sep 11 19:34:44 2024 +0530

    desc update

commit 3d8bf2bdc9c382a9f087b9ac6e63cb8604c99698
Author: Saksham Singh <sakshamsingh.93502@gmail.com>
Date:   Wed Sep 11 19:30:23 2024 +0530

    Added Razer Block

    Added the razer block by chris titus under the Fixes Section

* Moved razer-block from features to tweaks

* Updated tweaks.json

* Added option to enable ssh server under config tab

* Revert "Added option to enable ssh server under config tab"

This reverts commit ade414284d.

* Added Option to enable ssh server under config tab

* updated docs

* Removed #2715 from this PR

* update variable name

* Fixed authorized_keys file creation issue

auth key file was not being created due to incomplete file path from the $env:HOMEPATH and also corrected the ssh directory to .ssh
2024-10-01 14:20:45 -05:00