T

How to Install the OpenSSH Client (and Server) on Windows

36 views · updated 2026-07-01 · published 2026-07-01 · by Hasarinda Manjula · Windows Server Reading time: 3 min English සිංහල

Overview

OpenSSH lets you securely connect to remote machines and run commands over an encrypted channel. Windows includes OpenSSH as an optional feature — the client for connecting out, and the server for accepting incoming connections. This guide shows how to install and use both.

Windows includes OpenSSH client and server as optional features.

Key Takeaways

  • The OpenSSH Client is built into Windows — just enable the optional feature.
  • Use the command: ssh user@host to connect.
  • Install the OpenSSH Server to accept incoming SSH connections to the PC.
  • You can enable both from Settings or PowerShell.

Requirements

  • Windows 10 (1809+) or Windows 11.
  • Administrator rights to install the features.
  • For the server, a firewall rule allowing TCP port 22.

Method 1 — Install via Settings

1. Open Settings > System > Optional features.

2. Click "Add an optional feature" > View features.

3. Search for OpenSSH, tick OpenSSH Client (and OpenSSH Server if you need incoming connections).

4. Click Next > Install.

Confirm the OpenSSH installation.

Method 2 — Install via PowerShell

1. Open PowerShell as administrator.

2. Install the client: Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

3. Install the server: Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

4. Confirm with: Get-WindowsCapability -Online -Name OpenSSH*

Using the OpenSSH Client

1. Open Command Prompt, PowerShell, or Windows Terminal.

2. Connect to a remote machine: ssh username@hostname (or IP address).

3. Accept the host key the first time, then enter your password or use a key.

4. Run commands on the remote machine as if you were sitting at it.

Connecting to a remote PC over SSH.

Configuring the OpenSSH Server

1. Open PowerShell as administrator.

2. Start the service: Start-Service sshd

3. Set it to start automatically: Set-Service -Name sshd -StartupType Automatic

4. Allow it through the firewall: New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Server" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

5. Now other machines can connect to this PC with ssh.

Tip: For passwordless login, generate a key with ssh-keygen and copy your public key to the server’s authorized_keys file.

Troubleshooting

Problem: "ssh is not recognized".

Solution: Install the OpenSSH Client feature, then open a new terminal so the PATH refreshes.

Problem: Cannot connect to a Windows SSH server.

Solution: Ensure the sshd service is running, the firewall allows port 22, and you are using the correct username and IP.

Problem: Permission denied when logging in.

Solution: Check the username/password, and for key auth confirm your public key is in the server’s authorized_keys with correct permissions.

Problem: Add-WindowsCapability fails.

Solution: Run PowerShell as administrator and ensure you are online so the feature can download.

Conclusion

OpenSSH turns Windows into a capable SSH client and server. Enable the client to connect out with ssh user@host, add the server to accept incoming sessions, and use key-based auth for secure, passwordless logins.

</w:pBdr><w:spacing w:before="220" w:after="40"/></w:pPr><w:r><w:rPr><w:b/><w:bCs/><w:color w:val="0B5394"/><w:sz w:val="21"/><w:szCs w:val="21"/><w:rFonts w:ascii="Calibri" w:cs="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri"/></w:rPr><w:t xml:space="preserve">About TechHub

This guide is part of the TechHub Knowledge Base. For more step-by-step IT guides and support, visit techhub.com.lk.

Thanks for your feedback! 🙌

Read more

TechHub Assistant
Online · AI assistant
Thinking
⬇ Downloads 📦 Orders 🛒 Buy License 🎫 Create Ticket 🙋 Contact
AI-generated · may be inaccurate. Talk to a human