Secure Shell (SSH) is a powerful protocol that enables encrypted remote access to computers. In this guide, you’ll learn how to install and configure the OpenSSH server on Windows for secure connections.
Understanding SSH
SSH provides secure command-line access, file transfers, and remote command execution while protecting against unauthorized access. Starting from Windows 10 (build 1809) and continuing with Windows 11, the OpenSSH client is pre-installed by default. However, the OpenSSH server requires manual installation.
Client vs. Server
- OpenSSH Client: Allows users to connect securely to remote systems, enabling command-line access and file transfers.
- OpenSSH Server: Hosts SSH connections, allowing remote users to access and control the system securely.
SSH Requirements
Target Machine (the system you want to connect to):
- OpenSSH Server installed
- SSH daemon (sshd) running
- Port 22 open (or a custom SSH port)
Source Machine (the system you connect from):
- OpenSSH Client installed
- Used to initiate connections
- Most Linux distributions include SSH client by default
Installing OpenSSH Server on Windows
Step 1: Check if OpenSSH is Installed
Go to Settings > System > Optional Features or search for “Optional Features.” Look for OpenSSH Server. If not installed, click Add a feature, search for OpenSSH Server, and install it.
Step 2: Start and Enable SSH Server
Open PowerShell or Terminal as administrator and run:
Start-Service sshd Set-Service -Name sshd -StartupType Automatic
This ensures the SSH server starts automatically.
Step 3: Configure Firewall Rules
Allow SSH traffic by running:
New-NetFirewallRule -Name sshd -DisplayName "OpenSSH SSH Server" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Step 4: Verify SSH Server Status
Run:
Get-Service sshd
If the status is Running, your SSH server is active.
Password and Authentication Notes
Windows security policies require a password for SSH logins. Empty passwords are not permitted. To connect without a password, set up public key authentication or assign a password to your Windows account.
Enable Password Authentication
To enable password authentication:
- Open the
sshd_configfile (usually inC:\ProgramData\ssh\). - Find the line:
PasswordAuthentication no. - Change
notoyes. - Save the file and restart the SSH service:
Restart-Service sshd
After this, your Windows account password should work for SSH login.
Basic Usage
From the source machine, connect to the target machine using:
ssh username@target_ip_address
Example:
ssh john@192.168.1.100
By following these steps, you can successfully install and configure an SSH server on Windows, enabling secure remote access and management.
With SSH properly set up, you’ll have a reliable and secure way to connect to your Windows system remotely, whether for administration, file transfers, or development tasks.
