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
- Check if OpenSSH is installed. Open PowerShell (press Win, type
powershell, and hit Enter). RunGet-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'. Look forOpenSSH.Client—if it showsInstalled, skip to step 3. - 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. - Open a terminal. You can use PowerShell, Command Prompt, or Windows Terminal. Press Win, type
cmdorpowershell, and press Enter. - Connect to a remote server. Use the basic syntax:
ssh username@hostname. For example,ssh alice@192.168.1.100orssh alice@example.com. If the server uses a non-default port (e.g., 2222), add-p 2222before the username:ssh -p 2222 alice@hostname. - Accept the host key. The first time you connect, you’ll see a warning about the host’s authenticity. Type
yesand press Enter to continue. This adds the server to your known hosts file. - 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.
- Run commands. Once connected, you can type commands as if you were sitting at that machine. For example,
lslists files,pwdshows your current directory, andexitdisconnects. - 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\. - Generate an SSH key (optional but recommended). Run
ssh-keygen -t ed25519in 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) inC:\Users\YourName\.ssh\. - Copy your public key to the server. Use
ssh-copy-id username@hostnameif available (not built-in on Windows). Alternatively, manually append the contents ofid_ed25519.pubto~/.ssh/authorized_keyson 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
-pfor 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\configto define hosts, e.g.,Host myserverthenHostName 192.168.1.100andUser alice. Then just typessh 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 withStart-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
.sshfolder, 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
- How to Add & Remove Favorites in Windows 10 Photos App
- Fix Links Not Opening in Chrome: 7 Top Ways
- Connect Alexa to a Soundbar: Choose the Right Setup
- Fix Host Process for Setting Synchronization in Windows 10
- Windows 11 search how to control automatic indexing of frequently used folders?
- How to Set Up Tips on Twitter (X) for Android & iOS