How do I use OpenSSH on Windows?

Original query: "use OpenSSH windows"
Asked on April 16, 2026

OpenSSH on Windows lets you securely connect to other machines using SSH, transfer files using SFTP/SCP, and manage remote systems from the command line. Most modern Windows versions include an OpenSSH client, and you can optionally install the OpenSSH server if you need to accept incoming SSH connections. In practice, you will use the ssh command for remote login and scp/sftp for file transfer. Below is a practical, step-by-step guide to get started safely and correctly.

1) Check whether OpenSSH Client is installed

Open Windows Terminal or Command Prompt and run:

Command:

ssh -V

If you see a version, the client is installed. If not, install it from Windows Settings.

2) Install OpenSSH Client (if needed)

  • Open Settings → Apps → Optional features.
  • Find OpenSSH Client and click Install.
  • After installation, re-run ssh -V to confirm.

3) Connect to a remote server using SSH

Use the format ssh user@host. Example:

ssh [email protected]

Common options:

4) First-time connection and host key verification

On the first connection, Windows/SSH will ask you to verify the server’s host key (fingerprint). This is a security check to help prevent man-in-the-middle attacks. Only accept the key if it matches what the server owner provides.

5) Transfer files with SFTP or SCP

SFTP (interactive)

sftp [email protected]

Then use commands like put, get, ls, and cd.

SCP (copy files)

Upload:

scp C:\path\file.txt [email protected]:/home/username/

Download:

scp [email protected]:/home/username/file.txt C:\path\file.txt

6) (Optional) Enable OpenSSH Server on Windows

If you want your Windows PC to accept SSH connections, install and enable the server.

  • Install OpenSSH Server in Settings → Apps → Optional features.
  • Start the service: OpenSSH SSH Server.
  • Ensure firewall rules allow inbound TCP port 22 (or your chosen port).

After that, you can connect to your Windows machine from another computer using the same ssh format.

7) Recommended secure setup

  • Prefer key-based authentication over passwords.
  • Use a non-default SSH port only if you also keep strong authentication.
  • Store keys in %USERPROFILE%\.ssh with appropriate permissions.
  • Use ssh -v to troubleshoot connection issues.

8) Troubleshooting quick checks

  • “ssh is not recognized”: OpenSSH Client is not installed—install it via Optional features.
  • Permission denied (publickey): Your key path or key permissions may be wrong.
  • Connection timed out: Check network reachability and firewall/security group rules.
  • Host key changed: Verify you are connecting to the correct server.

If you tell me your Windows version (e.g., Windows 10/11), whether you need client only or also server, and your connection method (password or SSH key), I can provide exact commands tailored to your setup.