|
| 1 | +--- |
| 2 | +description: Microsoft.OpenSSH.SSHD/sshd_config resource reference documentation |
| 3 | +ms.date: 07/15/2025 |
| 4 | +ms.topic: reference |
| 5 | +title: Microsoft.OpenSSH.SSHD/sshd_config |
| 6 | +--- |
| 7 | + |
| 8 | +# Microsoft.OpenSSH.SSHD/sshd_config |
| 9 | + |
| 10 | +## Synopsis |
| 11 | + |
| 12 | +Manage SSH Server Configuration. |
| 13 | + |
| 14 | +## Metadata |
| 15 | + |
| 16 | +```yaml |
| 17 | +Version : 0.1.0 |
| 18 | +Kind : resource |
| 19 | +Tags : [OpenSSH, Windows, Linux] |
| 20 | +Author : Microsoft |
| 21 | +``` |
| 22 | +
|
| 23 | +## Instance definition syntax |
| 24 | +
|
| 25 | +```yaml |
| 26 | +resources: |
| 27 | + - name: <instance name> |
| 28 | + type: Microsoft.OpenSSH.SSHD/sshd_config |
| 29 | + properties: |
| 30 | + # Required properties |
| 31 | + map: object |
| 32 | +``` |
| 33 | +
|
| 34 | +## Description |
| 35 | +
|
| 36 | +The `Microsoft.OpenSSH.SSHD/sshd_config` resource allows you to export client |
| 37 | +and server configuration settings. The resource can: |
| 38 | + |
| 39 | +- Export client and server configuration settings |
| 40 | + |
| 41 | +> [!NOTE] |
| 42 | +> This resource is installed with DSC itself on systems. |
| 43 | +> |
| 44 | +> You can update this resource by updating DSC. When you update DSC, the updated version of this |
| 45 | +> resource is automatically available. |
| 46 | + |
| 47 | +## Requirements |
| 48 | + |
| 49 | +- The resource requires OpenSSH server and client to be installed on the Windows system. |
| 50 | +- The resource must run at least under a Windows Server 2019 or Windows 10 (build 1809) |
| 51 | + operating system. |
| 52 | + |
| 53 | +## Capabilities |
| 54 | + |
| 55 | +The resource has the following capabilities: |
| 56 | + |
| 57 | +- `export` - You can use the resource to export the current SSH server configuration. |
| 58 | + |
| 59 | +## Examples |
| 60 | + |
| 61 | +1. [Export OpenSSH configuration][00] - Shows how to export current OpenSSH configuration. |
| 62 | + |
| 63 | +## Properties |
| 64 | + |
| 65 | +The following list describes the properties for the resource. |
| 66 | + |
| 67 | +- **Required properties:** <a id="required-properties"></a> The following properties are always |
| 68 | + required when defining an instance of the resource. An instance that doesn't define each of these |
| 69 | + properties is invalid. For more information, see the "Required resource properties" section in |
| 70 | + [DSC resource properties][01] |
| 71 | + |
| 72 | + - [map](#map) - |
| 73 | + |
| 74 | +- **Key properties:** <a id="key-properties"> The following properties uniquely identify an |
| 75 | + instance. If two instances of a resource have the same values for their key properties, the |
| 76 | + instances are conflicting. For more information about key properties, see the "Key resource |
| 77 | + properties" section in [DSC resource properties][02]. |
| 78 | + |
| 79 | + - [map](#map) (required) - |
| 80 | + |
| 81 | +### map |
| 82 | + |
| 83 | +<details><summary>Expand for <code>map</code> property metadata</summary> |
| 84 | + |
| 85 | +```yaml |
| 86 | +Type : object |
| 87 | +IsRequired : true |
| 88 | +IsKey : false |
| 89 | +IsReadOnly : false |
| 90 | +IsWriteOnly : false |
| 91 | +``` |
| 92 | + |
| 93 | +</details> |
| 94 | + |
| 95 | +## Instance validating schema |
| 96 | + |
| 97 | +The following snippet contains the JSON Schema that validates an instance of the resource. The |
| 98 | +validating schema only includes schema keywords that affect how the instance is validated. All |
| 99 | +non validating keywords are omitted. |
| 100 | + |
| 101 | +```json |
| 102 | +{ |
| 103 | +"type": "object", |
| 104 | + "required": [ |
| 105 | + "map" |
| 106 | + ], |
| 107 | + "properties": { |
| 108 | + "map": { |
| 109 | + "type": "object", |
| 110 | + "additionalProperties": true |
| 111 | + } |
| 112 | + } |
| 113 | +} |
| 114 | +``` |
| 115 | + |
| 116 | +## Exit codes |
| 117 | + |
| 118 | +The resource returns the following exit codes from operations: |
| 119 | + |
| 120 | +- [0](#exit-code-0) - Success |
| 121 | +- [1](#exit-code-1) - Invalid parameter |
| 122 | + |
| 123 | +### Exit code 0 |
| 124 | + |
| 125 | +Indicates the resource operation completed without errors. |
| 126 | + |
| 127 | +### Exit code 1 |
| 128 | + |
| 129 | +Indicates the resource operation failed due to an invalid parameter. When the resource returns this |
| 130 | +exit code, it also emits an error message with details about the invalid parameter. |
| 131 | + |
| 132 | +## See also |
| 133 | + |
| 134 | +- [Microsoft.OpenSSH.SSHD/Windows resource][03] |
| 135 | +- For more information about OpenSSH, see [OpenSSH Documentation][04] |
| 136 | + |
| 137 | +<!-- Link definitions --> |
| 138 | +[00]: examples/export-openssh-configuration.md |
| 139 | +[01]: ../../../../../concepts/resources/properties.md#required-resource-properties |
| 140 | +[02]: ../../../../../concepts/resources/properties.md#key-resource-properties |
| 141 | +[03]: ../Windows/index.md |
| 142 | +[04]: /windowsserverdocs/WindowsServerDocs/administration/OpenSSH/openssh-overview |
0 commit comments