Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configurations/windows/.project.data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"SupportedPlatformOS": "Windows",
"CopyFiles": {
"Windows": [
"enable_ps_ssh_remoting.dsc.yaml",
"windows_baseline.dsc.yaml",
"windows_inventory.dsc.yaml"
]
Comment on lines 6 to 10
Expand Down
56 changes: 56 additions & 0 deletions configurations/windows/enable_ps_ssh_remoting.dsc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Installs PowerShell 7 and OpenSSH Server
# Enable PowerShell 7 remoting over SSH
Comment on lines +1 to +2
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
directives:
resourceDiscovery: duringDeployment
resources:
Comment on lines +3 to +6
- name: Install PowerShell 7
type: Microsoft.WinGet/Package
properties:
_exist: true
id: Microsoft.PowerShell
Comment on lines +7 to +11
- name: Install SSHD
type: Microsoft.Windows/FeatureOnDemandList
properties:
capabilities:
- identity: OpenSSH.Server~~~~0.0.1.0
state: Installed
Comment on lines +15 to +17
- name: Add PS7 SSH Subsystem
type: Microsoft.OpenSSH.SSHD/Subsystem
properties:
subsystem:
name: powershell
value: pwsh.exe -sshs
# Restarting the service will be handled by Actions in the future
- name: Stop SSHD Service
type: Microsoft.Windows/Service
properties:
name: sshd
status: Stopped
- name: Start SSHD Service and set to Automatic
type: Microsoft.Windows/Service
properties:
name: sshd
status: Running
startType: Automatic
- name: Open sshd firewall port
type: Microsoft.Windows/FirewallRuleList
properties:
rules:
- name: OpenSSH SSH Server (sshd)
description: Inbound rule for OpenSSH SSH Server (sshd)
applicationName: "[concat(systemRoot(), 'WINDOWS\\system32\\OpenSSH\\sshd.exe')]"
protocol: 6
Comment on lines +39 to +43
localPorts: '22'
remotePorts: '*'
localAddresses: '*'
remoteAddresses: '*'
direction: Inbound
action: Allow
enabled: true
profiles:
- Private
grouping: OpenSSH Server
interfaceTypes:
- All
Comment on lines +51 to +55
edgeTraversal: false
1 change: 1 addition & 0 deletions data.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"dsc-bicep-ext.exe",
"dscecho.exe",
"echo.dsc.resource.json",
"enable_ps_ssh_remoting.dsc.yaml",
"assertion.dsc.resource.json",
"featureondemand.dsc.resource.json",
"group.dsc.resource.json",
Expand Down
Loading