Windows/SSHD

From Omnia
Revision as of 18:30, 11 March 2026 by Kenneth (talk | contribs) (Created page with "== Install OpenSSH == Install the Inbox Version: <ref>https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell&pivots=windows-11</ref> # In Admin window: # Verify Admin (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) # Verify Capabilities Get-WindowsCapability -Online | Where-Object Name -lik...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Install OpenSSH

Install the Inbox Version: [1]

# In Admin window:
# Verify Admin
(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
# Verify Capabilities
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.ClientKenneth (talk) 18:30, 11 March 2026 (UTC)0.0.1.0
# alternative:
Add-WindowsCapability -Online -Name OpenSSH.Client*
# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.ServerKenneth (talk) 18:30, 11 March 2026 (UTC)0.0.1.0
# alternative:
Add-WindowsCapability -Online -Name OpenSSH.Server*

OR Install OpenSSH Preview/Beta Version with WinGet

# Preview version
winget install Microsoft.OpenSSH.Preview
# Beta version
winget install Microsoft.OpenSSH.Beta

Start the sshd service

Start-Service sshd

OPTIONAL but recommended, Set the service to start automatically:

Set-Service -Name sshd -StartupType Automatic

Open firewall: (owershell)

# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue)) {
    Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
    New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
    Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}
# alternative
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22