OpenSSH on Windows: Server Setup
OpenSSH is a tool for secure remote access via the SSH protocol. It encrypts all traffic, supports key-based authentication, and works on Windows, Linux, and macOS. 💡 After setup, you can connect to your Windows PC like a Linux server: ssh user@192.168.1.100 Requirements OS: Windows 10 (1809+), Windows 11, Windows Server 2019/2022 Privileges: Administrator Network: Access to port 22 (local or remote) Installation (3 ways) Option 1: PowerShell (recommended) # Run as Administrator # Install OpenSSH server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # Verify installation Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*' Option 2: DISM (alternative) dism /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~0.0.1.0 Option 3: Via Settings (GUI) Settings → Apps → Optional features “Add a feature” → find “OpenSSH Server” → Install Configure the service # Run as Administrator # Enable auto-start for sshd Set-Service -Name sshd -StartupType Automatic # Start the service Start-Service sshd # Check status Get-Service sshd # Verify port 22 is listening netstat -ano | findstr :22 Firewall # Check for OpenSSH rule Get-NetFirewallRule -Name *OpenSSH-Server* | Select Name, Enabled # If missing, create it New-NetFirewallRule -Name sshd ` -DisplayName 'OpenSSH Server' ` -Enabled True ` -Direction Inbound ` -Protocol TCP ` -LocalPort 22 ` -Action Allow ` -Profile Any Test connection # From the same PC ssh localhost # From another device on the network ssh <your_username>@<Windows_IP> # Example: ssh kirill@192.168.1.100 💡 First connection will ask to confirm the host key fingerprint - type yes. ...