| description | Microsoft.OpenSSH.SSHD/Windows resource reference documentation |
|---|---|
| ms.date | 07/02/2025 |
| ms.topic | reference |
| title | Microsoft.OpenSSH.SSHD/Windows |
Manage SSH server global configuration settings on Windows.
Version : 0.1.0
Kind : resource
Tags : [OpenSSH, Windows]
Author : Microsoftresources:
- name: <instance name>
type: Microsoft.OpenSSH.SSHD/Windows
properties:
# Instance properties
shell:
cmdOption:
escapeArguments:The resource only applies on systems where the sshd executable is available in PATH. DSC
evaluates this with the expression [not(equals(tryWhich('sshd'), null()))] and skips the
resource if sshd is not found.
The Microsoft.OpenSSH.SSHD/Windows resource enables you to idempotently manage the Windows
OpenSSH server global settings. These settings are stored in the Windows registry under
HKLM\SOFTWARE\OpenSSH and control the default shell behavior for SSH sessions:
- Set the default shell executable for SSH connections.
- Specify command-line options to pass to the default shell.
- Control whether shell arguments are escaped.
Note
This resource is installed with DSC itself on systems.
You can update this resource by updating DSC. When you update DSC, the updated version of this resource is automatically available.
- The resource requires OpenSSH server and client to be installed on the Windows system.
- The resource must run in a process context that has permissions to manage the SSH server configuration settings.
- The resource must run at least under a Windows Server 2019 or Windows 10 (build 1809) operating system or later.
The resource has the following capabilities:
get- You can use the resource to retrieve the actual state of an instance.set- You can use the resource to enforce the desired state for an instance.
This resource uses the synthetic test functionality of DSC to determine whether an instance is in the desired state. For more information about resource capabilities, see DSC resource capabilities.
- Configure default shell PowerShell - Shows how to set the default shell to PowerShell.exe
The following list describes the properties for the resource.
-
Instance properties: The following properties are optional. They define the desired state for an instance of the resource.
- shell - The path to the default shell for SSH.
- cmdOption - Specifies command-line options for the shell.
- escapeArguments - Specifies whether shell arguments should be escaped.
Expand for shell property metadata
Type : string, null
IsRequired : false
IsKey : false
IsReadOnly : false
IsWriteOnly : falseDefines the path to the default shell executable to use for SSH sessions. When specified, the value must be a valid path to an executable on the system.
Expand for cmdOption property metadata
Type : string, null
IsRequired : false
IsKey : false
IsReadOnly : false
IsWriteOnly : falseSpecifies optional command-line options to pass to the shell when it's launched.
Expand for escapeArguments property metadata
Type : boolean, null
IsRequired : false
IsKey : false
IsReadOnly : false
IsWriteOnly : falseDetermines whether shell arguments should be escaped. When set to true, the arguments will be
properly escaped before being passed to the shell.
The resource generates its schema dynamically at runtime by running
sshdconfig schema -s windows-global. The following snippet shows the effective schema that
validates an instance of the resource.
{
"type": "object",
"properties": {
"shell": {
"type": [
"string",
"null"
]
},
"cmdOption": {
"type": [
"string",
"null"
]
},
"escapeArguments": {
"type": [
"boolean",
"null"
]
}
}
}The resource returns the following exit codes from operations:
Indicates the resource operation completed without errors.
Indicates the resource operation failed due to an invalid parameter. When the resource returns this exit code, it also emits an error message with details about the invalid parameter.
- Microsoft.DSC/PowerShell resource
- For more information about OpenSSH, see OpenSSH Documentation