Installing and Enabling OpenSSH on Windows
- 1 Minute to read
- Print
- DarkLight
- PDF
Installing and Enabling OpenSSH on Windows
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
- Prerequisites:
- Ensure your device runs at least Windows Server 2019 or Windows 10 (build 1809).
- Have PowerShell 5.1 or later.
- Use an account that is a member of the built-in Administrators group.
- Validate Your Environment:
- Open an elevated PowerShell session.
- Type
winver.exe
to check your Windows version. - Run
$PSVersionTable.PSVersion
to verify PowerShell version. - Check if your account is part of the Administrators group with a specific PowerShell command.
- Install OpenSSH (GUI Method):
- Go to Settings → System → Optional Features.
- Check if OpenSSH is installed. If not, select Add a feature, then find and install both OpenSSH Client and Server.
- Confirm OpenSSH is listed in System and Optional Features.
- Open the Services app, find OpenSSH SSH Server, set its startup type to Automatic, and start the service.
- Install OpenSSH (PowerShell Method):
- Run PowerShell as Administrator.
- Check if OpenSSH is available using
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
. - Install the OpenSSH Client and Server using specific Add-WindowsCapability commands.
- Start and configure the OpenSSH Server with
Start-Service sshd
and optionally set it to start automatically.
- Allowing SSH Port 22 in Windows Firewall:
To ensure secure SSH communication, it's crucial to configure the Windows Firewall to allow traffic through port 22. Follow these steps:- Open Windows Defender Firewall: Search and open it from the Windows search bar.
- Advanced Settings: Click on “Advanced settings” in the left pane.
- New Inbound Rule: Under “Inbound Rules”, click “New Rule”.
- Port Configuration: Select “Port”. Choose “TCP” and enter “22” as the specific port.
- Allow Connection: Select “Allow the connection”.
- Profile Selection: Choose the applicable profiles (Domain, Private, Public).
- Naming the Rule: Name the rule (e.g., “SSH Port 22”) and provide a description. Finish by clicking “Finish”.
Was this article helpful?