TechBuzzPro

OpenSSH Server on Windows 10/11: Secure Remote Access Guide

· 4 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can run an OpenSSH server directly on Windows 10 and 11 to enable secure remote command-line access via SSH. This feature is built into the operating system but requires manual installation of the optional component and configuration of the service. Once enabled, it allows you to connect to your PC from another machine using standard SSH clients, providing encrypted remote management without third-party software.

What You'll Need

  • A Windows 10 (version 1809 or later) or Windows 11 device.
  • Administrator privileges on the Windows machine.
  • A local user account with a password (SSH does not support passwordless login by default for security reasons).
  • An SSH client on the connecting device (built-in in Linux/macOS, available via PuTTY or OpenSSH on other Windows PCs).

Step-by-Step

  1. Install the OpenSSH Server Feature: Press Win + I to open Settings. Navigate to Apps > Optional features. Click the Add a feature button. In the search box, type "OpenSSH Server". Select OpenSSH Server from the results and click Next, then Install. Wait for the installation to complete. Note that menu labels may vary slightly depending on your specific Windows version.
  2. Start the SSH Service: Open PowerShell as Administrator. Run the following command to start the service immediately: Start-Service sshd.
  3. Set Automatic Startup: To ensure the SSH server starts every time your computer boots, run this command in the same PowerShell window: Set-Service -Name sshd -StartupType 'Automatic'.
  4. Configure the Firewall: The installer usually creates a firewall rule automatically, but it is wise to verify it. In PowerShell (Admin), run: New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22. If the rule already exists, this command will return an error indicating the name is already in use, which is safe to ignore.
  5. Verify the Service Status: Check that the service is running by executing: Get-Service sshd. The status should show as "Running". You can also check the Services app by pressing Win + R, typing services.msc, and looking for "OpenSSH SSH Server".
  6. Connect Remotely: From another computer, open a terminal and type: ssh username@your_windows_ip_address. Replace username with your Windows local account name and your_windows_ip_address with the IP address of the Windows machine (find this by running ipconfig in Windows CMD). Accept the security fingerprint if prompted, then enter your Windows password.

Common Mistakes

One frequent error is attempting to log in with a Microsoft Account email instead of the local username. SSH on Windows typically authenticates against local SAM accounts. If you signed in with a Microsoft Account, you must use the email address as the username or create a dedicated local user. Another mistake is forgetting that the default SSH port is 22; if your network blocks this port, connections will fail. Additionally, users often overlook the need for a password; SSH keys are supported but require extra configuration steps beyond the basic setup described here.

Tips

For enhanced security, consider disabling password authentication and using SSH keys instead, though this requires generating keys on the client side. Always keep Windows updated, as Microsoft frequently patches security vulnerabilities in the OpenSSH implementation. If you are accessing your PC from outside your home network, ensure your router forwards port 22 to the Windows machine's local IP, and be aware that exposing SSH directly to the internet carries risks; using a VPN is a safer alternative for remote access.

Troubleshooting

If you cannot connect, first verify that the sshd service is actually running in the Services manager. Check the Windows Event Viewer under Applications and Services Logs > OpenSSH > Admin for detailed error logs. Ensure your firewall is not blocking inbound traffic on port 22 by temporarily disabling it for testing purposes only. If you receive a "Connection Refused" error, the service might not be listening; restart the service with Restart-Service sshd. For authentication failures, double-check that you are using the correct username and that the account has a password set. If the connection times out, check your network connectivity and router settings.

Frequently Asked Questions

Can I use OpenSSH Server on Windows 10 Home?

Yes, the OpenSSH Server feature is available on all editions of Windows 10 (1809+) and Windows 11, including Home edition.

Does OpenSSH work with Microsoft Accounts?

Yes, but you must use the full Microsoft Account email address as the username when logging in via SSH.

Is it safe to leave OpenSSH running permanently?

It is reasonably safe if configured correctly, but exposing it to the internet increases risk. Use strong passwords or SSH keys, and consider restricting access to specific IP addresses via firewall rules.

How do I find my Windows IP address?

Open Command Prompt or PowerShell and type ipconfig. Look for the IPv4 Address under your active network adapter.

Can I use a different port than 22?

The default configuration uses port 22. Changing the port requires editing the sshd_config file located in C:\ProgramData\ssh\ and restarting the service, which adds complexity.

Why is my SSH connection slow?

SSH encryption adds slight overhead, but slowness is usually due to network latency or high CPU usage on the Windows machine. Ensure background updates are not running during heavy usage.