sodcalculator

10 Tech How-To

SSH in Windows 10: Setup & Use Guide

Guide 10-57594 · Updated · Step by step

This guide walks you through using SSH (Secure Shell) in Windows 10 to securely connect to remote servers, transfer files, and run commands. You’ll learn how to enable the built-in OpenSSH client, generate keys, and connect to a remote machine—no extra software needed.

What You’ll Need

  • Windows 10 (version 1803 or later recommended)
  • Administrator access to enable the SSH feature (if not already enabled)
  • The hostname or IP address of the server you want to connect to
  • Your username and password (or an SSH key) for that server

Step-by-Step

  1. Check if OpenSSH is installed. Open PowerShell (press Win, type powershell, and hit Enter). Run Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'. Look for OpenSSH.Client—if it shows Installed, skip to step 3.
  2. Install the OpenSSH client. If not installed, run PowerShell as Administrator (right-click PowerShell and choose “Run as administrator”), then run: Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0. Wait for the installation to complete.
  3. Open a terminal. You can use PowerShell, Command Prompt, or Windows Terminal. Press Win, type cmd or powershell, and press Enter.
  4. Connect to a remote server. Use the basic syntax: ssh username@hostname. For example, ssh alice@192.168.1.100 or ssh alice@example.com. If the server uses a non-default port (e.g., 2222), add -p 2222 before the username: ssh -p 2222 alice@hostname.
  5. Accept the host key. The first time you connect, you’ll see a warning about the host’s authenticity. Type yes and press Enter to continue. This adds the server to your known hosts file.
  6. Enter your password. When prompted, type your password (it won’t show on screen—that’s normal) and press Enter. You should now be logged into the remote shell.
  7. Run commands. Once connected, you can type commands as if you were sitting at that machine. For example, ls lists files, pwd shows your current directory, and exit disconnects.
  8. Transfer files with SCP. To copy a file from your PC to the remote server, use: scp C:\path\to\file.txt username@hostname:/remote/path/. To copy from the remote to your PC, reverse the order: scp username@hostname:/remote/file.txt C:\local\path\.
  9. Generate an SSH key (optional but recommended). Run ssh-keygen -t ed25519 in your terminal. Press Enter to accept the default file location, and optionally set a passphrase. This creates a public key (id_ed25519.pub) and private key (id_ed25519) in C:\Users\YourName\.ssh\.
  10. Copy your public key to the server. Use ssh-copy-id username@hostname if available (not built-in on Windows). Alternatively, manually append the contents of id_ed25519.pub to ~/.ssh/authorized_keys on the remote server. Then you can log in without a password.

Common Mistakes

  • Typing the password and seeing nothing. The terminal doesn’t show asterisks or dots for password input—it just sits there. Type your password and press Enter.
  • Using the wrong username. Make sure you use the username for the remote server, not your local Windows username (unless they’re the same).
  • Forgetting the port. If the server uses a non-standard port and you don’t specify it, the connection will fail. Always use -p for non-default ports.
  • Path issues with SCP. Windows paths with backslashes can confuse SCP. Use forward slashes or escape the backslashes: scp C:/Users/me/file.txt user@host:/tmp/.
  • Firewall blocking. Windows Firewall or antivirus may block outbound SSH. Temporarily disable the firewall to test, but ensure it’s re-enabled.

Tips

  • Use SSH keys for automation. Keys are more secure than passwords and allow scripted logins without prompting.
  • Set up an SSH config file. Create C:\Users\YourName\.ssh\config to define hosts, e.g., Host myserver then HostName 192.168.1.100 and User alice. Then just type ssh myserver.
  • Keep your private key safe. Never share your private key (id_ed25519). Use a passphrase to protect it.
  • Use Windows Terminal. It supports multiple tabs and better keyboard shortcuts than the default console.
  • Enable SSH server on Windows 10 (optional). If you want to SSH into your Windows machine, install the OpenSSH Server feature similarly: Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0, then start the service with Start-Service sshd.

Troubleshooting

  • “Connection refused” – The server isn’t running SSH or the port is wrong. Check the server’s SSH service and that the port is open.
  • “Permission denied (publickey,password)” – Your credentials are wrong, or the server doesn’t allow password auth. Double-check username and password, or ensure your public key is correctly placed in authorized_keys.
  • “Host key verification failed” – The server’s key has changed (e.g., after reinstall). Remove the old key from C:\Users\YourName\.ssh\known_hosts (edit the file and delete the line for that host) and try again.
  • “Connection timed out” – Network issue or firewall. Ping the server to check connectivity, and verify port 22 (or custom port) is reachable.
  • “Bad owner or permissions” on .ssh folder – On Windows, this can happen if the folder permissions are too loose. Reset permissions: right-click the .ssh folder, go to Properties > Security, and ensure only your user has full control.
  • Command not found (ssh is not recognized) – OpenSSH isn’t installed. Re-check step 2, or restart your terminal after installation.

Frequently Asked Questions

Do I need to install PuTTY?

No. Windows 10 includes a built-in OpenSSH client that works well for most tasks. PuTTY is only needed if you prefer its interface or need specific features like saved sessions.

How do I exit an SSH session?

Type exit and press Enter, or press Ctrl+D (if the remote shell supports it).

Can I SSH to a server using a private key file?

Yes. Use ssh -i C:\path\to\private_key username@hostname. Ensure the key file has restrictive permissions (only your user).

How do I change my SSH password?

That’s managed on the remote server. Once connected, run passwd (Linux) or the appropriate command for the server’s OS.

Is SSH secure over public Wi-Fi?

Yes, SSH encrypts all traffic, so it’s safe to use over public networks. However, always verify the host key to avoid man-in-the-middle attacks.

Can I run graphical applications over SSH?

Yes, but you need X11 forwarding. Use ssh -X username@hostname and have an X server (like Xming) installed on Windows.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →