Skip to content

sshd resource fails if sshd_config doesn't exist #1469

@SteveL-MSFT

Description

@SteveL-MSFT

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Summary

Used config to install SSHD FOD and then configure it, but it fails with error:

2026-04-08T01:38:05.659706Z ERROR trace_message="PID 1328: Command: __PROGRAMDATA__\\ssh/sshd_config: No such file or directory\r\n"
2026-04-08T01:38:05.664277Z ERROR Failed to run process 'sshdconfig': Command: Resource 'sshdconfig' [exit code 1]
2026-04-08T01:38:05.668695Z ERROR Error: Command: Resource 'sshdconfig' [exit code 1]

Steps to reproduce

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Install PowerShell 7
  type: Microsoft.WinGet/Package
  properties:
    id: Microsoft.PowerShell
- name: Install SSHD
  type: Microsoft.Windows/FeatureOnDemandList
  properties:
    capabilities:
    - identity: OpenSSH.Server~~~~0.0.1.0
      state: Installed
- name: Add PS7 SSH Subsystem
  type: Microsoft.OpenSSH.SSHD/Subsystem
  properties:
    subsystem:
      name: powershell
      value: C:/progra~1/powershell/7/pwsh.exe -sshs
- name: Start SSHD Service
  type: Microsoft.Windows/Service
  properties:
    name: sshd
    status: Running
    startType: Automatic

Expected behavior

Should install and setup sshd in one config

Actual behavior

Error

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.6.0
PSEdition                      Core
GitCommitId                    7.6.0
OS                             Microsoft Windows 10.0.26200
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

3.2-preview.14

Visuals

No response

Metadata

Metadata

Assignees

Labels

Issue-BugSomething isn't working

Type

No type

Projects

Status

Reviewed

Relationships

None yet

Development

No branches or pull requests

Issue actions