Skip to content

Preserve original sshdconfig validation diagnostics - #1807

Merged
Steve Lee (SteveL-MSFT) merged 1 commit into
PowerShell:mainfrom
SteveL-MSFT:stevel-msft-sshdconfig-elevation-error
Nov 14, 2026
Merged

Steve Lee (SteveL-MSFT) merged 1 commit into
PowerShell:mainfrom
SteveL-MSFT:stevel-msft-sshdconfig-elevation-error

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

sshdconfig reports "elevated security context required" for both missing host keys and permission failures from sshd -T, hiding the actual failure even when DSC is elevated.

Preserve the complete original OpenSSH diagnostic through the existing command-error path. Validation behavior stays unchanged: no automatic key generation, service startup, permission changes, or bypass of failed validation. Add focused regression coverage and document host-key initialization and troubleshooting.

Validation

  • Targeted build.ps1 build and Clippy passed.
  • All 37 Rust tests passed. The new diagnostic regression failed against the previous translation and passed after the fix.
  • Pester: 5 passed, 64 skipped, 0 failed. Although sshd is now installed, this session is not elevated; sshd -T also reports a missing default configuration. Full OpenSSH integration coverage remains unverified.

Fixes: #1806

Stop reporting missing host keys and permission failures as an elevation requirement. Add diagnostic regression coverage and document host-key setup and troubleshooting.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 23:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change preserving SSHD validation diagnostics.

No open issues 🎉

What changed in this PR

Addresses #1806 by preserving OpenSSH validation diagnostics in the SSHD configuration resource instead of replacing host-key and permission errors with a generic elevation message. Failed validation still blocks the operation.

Changes:

  • Preserve original diagnostics through the existing command-error path.
  • Add regression tests for failure diagnostics and successful output.
  • Document host-key prerequisites, initialization, and permission troubleshooting.
File Description
resources/​sshdconfig/​src/​util.rs Extracts output parsing, removes diagnostic replacement, and adds regression tests.
resources/​sshdconfig/​locales/​en-us.toml Removes the unused generic elevation message.
docs/​reference/​resources/​Microsoft/​OpenSSH/​SSHD/​sshd_config/​index.md Documents host-key requirements and validation troubleshooting.

Review effort: Balanced

@SteveL-MSFT
Steve Lee (SteveL-MSFT) merged commit 5caeb47 into PowerShell:main Nov 14, 2026
27 checks passed
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the stevel-msft-sshdconfig-elevation-error branch November 14, 2026 00:29
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

Successfully merging this pull request may close these issues.

sshdconfig resources errors with "elevated security context required" even when running under an elevated context

2 participants