Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Enable OpenSSH Windows 11: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What Is OpenSSH and Why Would You Want It?
  2. How to Enable OpenSSH Client on Windows 11
  3. How to Enable OpenSSH Server on Windows 11
  4. Configuring and Connecting for the First Time
  5. Common Problems and How to Fix Them
  6. Security Considerations and Best Practices
  7. Alternatives to OpenSSH on Windows 11
  8. Frequently Asked Questions

Yes, you can enable OpenSSH on Windows 11 through the Settings app or PowerShell, and it takes less than five minutes. OpenSSH is built into Windows 11 as an optional feature, so you don't need to download anything from the internet—just activate it and start using SSH for secure remote connections.

What Is OpenSSH and Why Would You Want It?

OpenSSH (Open Secure Shell) is a set of networking tools that lets you securely connect to remote computers, transfer files, and run commands over an encrypted channel. It's the standard for remote administration on Linux and macOS, and Microsoft has included it natively in Windows 10 and 11 since 2018. Enabling it on Windows 11 gives you the same command-line capabilities as on other platforms: you can SSH into a Linux server, GitHub, or another Windows machine, and you can also let others connect to your PC.

Many developers enable OpenSSH to manage cloud servers, deploy code, or use Git over SSH. System administrators use it to remotely manage Windows machines in a domain. Even if you're not a power user, you might want it to securely copy files with SCP or SFTP instead of using unencrypted FTP.

How to Enable OpenSSH Client on Windows 11

The OpenSSH Client is a lightweight program that lets you connect to other machines. It's often already installed, but if not, here's how to add it:

  1. Open Settings (Win + I) and go to Apps > Optional Features.
  2. Click View features next to “Add an optional feature.”
  3. Type “OpenSSH Client” in the search box.
  4. Select OpenSSH Client and click Install.

Alternatively, you can use PowerShell as an administrator:

  • Right-click the Start button and select Windows Terminal (Admin) or PowerShell (Admin).
  • Run: Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
  • Wait for the process to finish, then close and reopen your terminal.

After installation, test it by typing ssh in a terminal. You should see a usage message listing options like -p port and -i identity_file.

How to Enable OpenSSH Server on Windows 11

If you want to accept incoming SSH connections—for example, to remote into your Windows PC from another device—you need the OpenSSH Server. Here's the process:

  1. Go to Settings > Apps > Optional Features.
  2. Click View features, search for “OpenSSH Server,” and install it.
  3. After installation, open Services (type services.msc in Run).
  4. Find OpenSSH SSH Server, right-click it, and select Start.
  5. To make it start automatically every time, right-click again, choose Properties, set the Startup type to Automatic, and click OK.

You can also do this entirely in PowerShell (admin):

  • Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
  • Start-Service sshd
  • Set-Service -Name sshd -StartupType 'Automatic'

Once the server is running, Windows Firewall will usually prompt you to allow the port. If not, you may need to add a rule manually for TCP port 22.

Configuring and Connecting for the First Time

After enabling the client, you can connect to a remote machine with a simple command:

  • ssh username@hostname – for example, ssh admin@192.168.1.10
  • If the remote server uses a non-default port, use ssh -p 2222 username@hostname.

For the server side, you'll need to know your Windows username and either your password or an SSH key. By default, OpenSSH on Windows uses the local user's password for authentication. To connect, from another machine run the same SSH command with your Windows username and the PC's IP address. You can find your IP with ipconfig in a terminal.

If you want key-based authentication, you can generate a key pair with ssh-keygen and then place the public key in a special file on the Windows machine. The location is typically C:\Users\YourName\.ssh\authorized_keys for administrators, but the exact path can vary depending on whether the account is a standard user or an administrator.

Common Problems and How to Fix Them

Many users run into a few typical issues when enabling OpenSSH on Windows 11. Here are the most frequent ones and their solutions:

  • “ssh” is not recognized as a command – This means the client isn't installed. Check Optional Features or re-run the PowerShell install command.
  • Connection refused – The server isn't running or the firewall is blocking port 22. Verify the service is started and that the firewall rule exists.
  • Permission denied (publickey,password) – Usually means the username or password is wrong, or password authentication is disabled. Check the sshd_config file (in C:\ProgramData\ssh\sshd_config) and ensure PasswordAuthentication yes is set if you want to use passwords.
  • Host key verification failed – This happens when the remote machine's key has changed. Clear the old key with ssh-keygen -R hostname.
  • Administrator issues – If you're connecting as an administrator, Windows may restrict the default shell. You might need to change the default shell from cmd.exe to PowerShell in the registry or use a standard user account.

Security Considerations and Best Practices

Exposing your Windows machine to SSH opens a port that attackers can try to exploit. Here are essential safety measures:

  • Use strong passwords or, better, SSH keys. Keys are nearly impossible to brute-force.
  • Change the default port (22) to something else to reduce automated attacks. Edit the Port line in sshd_config and restart the service.
  • Disable password authentication if you use keys, by setting PasswordAuthentication no in the config file.
  • Keep Windows and OpenSSH updated to get security patches.
  • Use a firewall to restrict which IP addresses can connect to port 22. You can create an inbound rule that only allows your specific IP.
  • Consider using a non-administrator account for remote logins to limit damage if compromised.

Remember that OpenSSH on Windows uses the same encryption as on Linux, so it's secure as long as you configure it properly. Avoid using default credentials or leaving the default port open to the public internet without protection.

Alternatives to OpenSSH on Windows 11

While OpenSSH is built-in, you might consider alternatives depending on your needs:

  • PuTTY – A popular third-party SSH client with a graphical interface. It's useful if you prefer a GUI over the command line.
  • Windows Subsystem for Linux (WSL) – If you install a Linux distribution via WSL, you can use the full OpenSSH suite from within that environment, which sometimes has better compatibility with key management.
  • PowerShell Remoting (WinRM) – Microsoft's native remote management tool, which uses a different protocol (WS-Management) and can run PowerShell commands remotely. It's more integrated with Windows administration but less universal than SSH.
  • Third-party SSH servers like Bitvise SSH Server – These offer more configuration options and a GUI, but they're not free or built-in.

For most users, the built-in OpenSSH is sufficient and the best choice because it's free, integrated, and follows the standard SSH protocol.

Frequently Asked Questions

Is OpenSSH free on Windows 11?

Yes, OpenSSH is completely free and included with Windows 11 as an optional feature. There's no cost to install or use it, unlike some commercial SSH servers.

Do I need to install both client and server?

No. Install only the client if you need to connect to other machines. Install only the server if you need to accept incoming connections. Many people install both, but it's not required.

Can I use OpenSSH to transfer files?

Yes, you can use the scp command or sftp to securely copy files to and from a remote machine. For example: scp file.txt user@host:/path/to/destination.

How do I uninstall OpenSSH from Windows 11?

Go to Settings > Apps > Optional Features, find OpenSSH Client or Server, click it, and select Uninstall. Or use PowerShell: Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0.

Does OpenSSH work with Windows Firewall?

Yes, but you may need to add a firewall rule for TCP port 22 if the automatic prompt doesn't appear. You can do this in Windows Defender Firewall with Advanced Security.