Use this when enabling SSH access to Windows.
OpenSSH Server
OpenSSH Server is an optional Windows feature (Add-WindowsCapability -Name OpenSSH.Server) providing sshd for secure remote shells and file transfer. Configure it in C:\ProgramData\ssh\sshd_config.
1. Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Server*' — installed.
2. Get-Service sshd running, Automatic.
3. Firewall rule OpenSSH-Server-In-TCP.
4. Admins' keys in C:\ProgramData\ssh\administrators_authorized_keys (ACL!).
5. Test ssh user@host.
sshd service → port 22 → key/password auth → shell (cmd/PowerShell)
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Wrong ACLs on
administrators_authorized_keys.
Step 2 Where it fails Narrow the fault
Failure analysis for Remote Access → OpenSSH Server follows the Windows chain of components: host/interface identity → local config/routing/name state → Windows service/provider → firewall/security/session → remote service → application-visible exchange.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- OpenSSH Server is an optional Windows capability.
- Its configuration is in C:\ProgramData\ssh\sshd_config.
- Administrators' keys go in administrators_authorized_keys.
Test-NetConnection <host> -Port 3389— RDP portGet-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections— RDP enabled (0)Test-WSMan <host>— WinRMGet-Service sshd— OpenSSH server
ReferenceImportant terms & boundaries2 sections · depth on demand
Install and configure
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd ; Set-Service sshd -StartupType Automatic
Get-NetFirewallRule -Name *OpenSSH*
Documented example, not captured output. Config: C:\ProgramData\ssh\sshd_config; admin keys in administrators_authorized_keys with strict ACLs.
In depth
OpenSSH Server on Windows (built-in capability):
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd; Set-Service sshd -StartupType Automatic
New-ItemProperty -Path HKLM:\SOFTWARE\OpenSSH -Name DefaultShell -Value 'C:\Program Files\PowerShell\7\pwsh.exe' -PropertyType String -Force
Get-Content $env:ProgramData\ssh\sshd_config
Keys for administrators go in C:\ProgramData\ssh\administrators_authorized_keys (with strict ACLs: SYSTEM and Administrators only), not in the user's .ssh folder. Windows Server 2025 includes sshd installed (disabled) by default.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Remote Access → OpenSSH Server. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/ · confidence 94%