Skip to content

docs: Add reference documentation for Microsoft.OpenSSH.SSHD/Windows#934

Open
Gijsreyn wants to merge 15 commits into
PowerShell:mainfrom
Gijsreyn:reference-doc-sshdconfig
Open

docs: Add reference documentation for Microsoft.OpenSSH.SSHD/Windows#934
Gijsreyn wants to merge 15 commits into
PowerShell:mainfrom
Gijsreyn:reference-doc-sshdconfig

Conversation

@Gijsreyn
Copy link
Copy Markdown
Collaborator

@Gijsreyn Gijsreyn commented Jul 2, 2025

PR Summary

As part of #665, this PR adds reference documentation for the Microsoft.OpenSSH.SSHD/Windows resource.

PR Context

@Gijsreyn Gijsreyn force-pushed the reference-doc-sshdconfig branch from 598a6fe to e0fedee Compare July 2, 2025 14:13
@Gijsreyn Gijsreyn force-pushed the reference-doc-sshdconfig branch from e0fedee to fa1b824 Compare July 15, 2025 04:34
@Gijsreyn Gijsreyn marked this pull request as ready for review July 15, 2025 05:10
@Gijsreyn
Copy link
Copy Markdown
Collaborator Author

Hi @tgauth, I saw #907 got merged and thought of creating some reference documentation. Do you mind for a review :)?

@Gijsreyn Gijsreyn force-pushed the reference-doc-sshdconfig branch from adb4db3 to c6dba04 Compare July 21, 2025 23:25
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md Outdated
@Gijsreyn Gijsreyn force-pushed the reference-doc-sshdconfig branch from c6dba04 to 8df2b25 Compare July 29, 2025 00:29
@Gijsreyn Gijsreyn force-pushed the reference-doc-sshdconfig branch from 8df2b25 to 3509e6b Compare August 11, 2025 23:02
Copilot AI review requested due to automatic review settings May 7, 2026 02:16
@Gijsreyn Gijsreyn force-pushed the reference-doc-sshdconfig branch from 3509e6b to 40d6808 Compare May 7, 2026 02:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds reference documentation under docs/reference/resources for the built-in OpenSSH DSC resources, intended to support issue #665 (“Document built-in resources”).

Changes:

  • Adds a new reference page and example for Microsoft.OpenSSH.SSHD/Windows.
  • Adds a new reference page for Microsoft.OpenSSH.SSHD/sshd_config.
  • Adds (but currently leaves empty) an sshd_config example page referenced from the new index.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 17 comments.

File Description
docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md New reference doc for the Windows OpenSSH “windows-global” resource (default shell settings).
docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/examples/configure-default-shell-powershell.md New example showing how to set the default shell to Windows PowerShell.
docs/reference/resources/Microsoft/OpenSSH/SSHD/sshd_config/index.md New reference doc for the sshd_config resource (but currently mismatches actual resource schema/capabilities).
docs/reference/resources/Microsoft/OpenSSH/SSHD/sshd_config/examples/export-openssh-configuration.md Example file referenced by the docs, but currently empty.

Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md Outdated
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md Outdated
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md Outdated
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md Outdated
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/Windows/index.md Outdated
Comment thread docs/reference/resources/Microsoft/OpenSSH/SSHD/sshd_config/index.md Outdated
@Gijsreyn Gijsreyn force-pushed the reference-doc-sshdconfig branch from fc9176a to 3cc2e29 Compare May 7, 2026 14:48
@Gijsreyn Gijsreyn changed the title Add reference documentation for Microsoft.OpenSSH.SSHD/Windows docs: Add reference documentation for Microsoft.OpenSSH.SSHD/Windows May 10, 2026
Comment on lines +60 to +62
> [!NOTE]
> The output is truncated in this example. The actual output includes all effective
> `sshd_config` directives for your system, including defaults inherited from OpenSSH.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The default behavior for export will actually not include inherited defaults, but get will.
To override the default for either one, the boolean property _includeDefaults can be used.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

when includeDefaults is true, in addition to the property: value output, the names of any inherited properties, are listed under an _inheritedDefaults array, i.e. _inheritedDefaults: [port, addressfamily]

To re-apply the saved configuration to a system, use the [dsc config set][01] command:

```powershell
dsc config set --document sshd_backup.dsc.config.yaml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use _purge = true to apply the saved configuration exactly.
By default, _purge = false, so any other directives in the file on another system will not be overwritten.

permitrootlogin = 'no'
} | ConvertTo-Json

dsc resource get --resource Microsoft.OpenSSH.SSHD/sshd_config --input $instance
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
dsc resource get --resource Microsoft.OpenSSH.SSHD/sshd_config --input $instance
dsc resource export --resource Microsoft.OpenSSH.SSHD/sshd_config --input $instance

use export here - get does not support filtering by keyword

2. [Manage SSH server configuration settings][02] - Shows how to get and set specific sshd_config
directives.

## Properties
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure if here or the requirements section above would be a good place to note that metadata can be used specify a non-default sshd_config filepath, such as:

metadata:
  filepath: "c:\\programdata\\ssh\\non_default_sshd_config"

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.

4 participants