How to SSH into Windows 10?

The latest builds of Windows 10 include a build-in SSH server and client that are based on OpenSSH. This means that now you can remotely connect to Windows 10 (Windows Server 2019) using any SSH client, like to Linux distro. In this article, we’ll show you how to configure OpenSSH in Windows 10 and connect to it using Putty or any other SSH client.

Make sure your build of Windows 10 is 1809 or newer. The easiest way to do this is by running the command:


ssh into windows 10

Note If you have an older Windows 10 build installed, you can update it through Windows Update or using an ISO image with a newer version of Windows 10 (you can create image using the Media Creation Tool). If you don’t want to update your Windows 10 build, you can manually install the Win32-OpenSSH port for Windows with GitHub (

You can enable OpenSSH server in Windows 10 through graphical Settings panel:

  1. Go to the Settings > Apps > Optional features;
    ssh windows 10
  2. Click Add a feature, select OpenSSH Server (OpenSSH-based secure shell (SSH) server, for secure key management and access from remote machines), and click Install

openssh windows

You can also install sshd server using PowerShell:

Add-WindowsCapability -Online -Name OpenSSH.Server*

windows 10 ssh server

Or using DISM:

dism /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~

If you want to make sure that the OpenSSH server is installed, run the following PS command:

Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Server*'

Name : OpenSSH.Server~~~~

READ ALSO  Using RDCMan to Manage Multiple RDP sessions

State : Installed

openssh server windows

Check the status of ssh-agent and sshd services using the PowerShell command Get-Service:

Get-Service -Name *ssh*

ssh windows server

As you can see, both services are in Stopped state and are not added to automatic startup list. To start services and configure autostart for them, run the following commands:

Start-Service sshd

Set-Service -Name sshd -StartupType 'Automatic'

Start-Service ‘ssh-agent’

Set-Service -Name ‘ssh-agent’ -StartupType 'Automatic'

install openssh windows

You also need to allow incoming connections to TCP port 22 in the Windows Defender Firewall:

netsh advfirewall firewall add rule name=”SSHD service” dir=in action=allow protocol=TCP localport=22

Now you can connect to Windows 10 using any SSH client. To connect from Linux, use the command:

ssh -p 22 admin@

where, admin is the local Windows user you want to connect under – IP address of your Windows 10 computer

windows 10 openssh server

After that, a new Windows command prompt window will open in SSH session.

Hint. In order to run the PoweShell console instead of cmd.exe shell when logging in via SSH on Windows 10, you need to run the following command in Windows 10 (under admin account):

New-ItemProperty -Path “HKLM:SOFTWAREOpenSSH” -Name DefaultShell -Value “C:WindowsSystem32WindowsPowerShellv1.0powershell.exe” -PropertyType String –Force

So you change the default OpenSSH shell. Now, when connecting to Windows via SSH, you will immediately see PowerShell prompt instead of cmd.exe.

READ ALSO  How to Set Up Static IP Address in Windows 10?

enable ssh windows 10

If you want to use key-based ssh authentication instead of password authentication, you need to generate a key using ssh-keygen on your client.

Then, the contents of the file must be copied to the c:usersadmin.sshauthorized_keys file in Windows 10.

After that, you can connect from your Linux client to Windows 10 without a password. Use the command:

ssh -l admin@

You can configure various OpenSSH server settings in Windows using the %programdata%sshsshd_config configuration file.

ssh windows 10 command line

For example, you can disable password authentication and leave only key-based auth with:

PubkeyAuthentication yes

PasswordAuthentication no
Cyril Kardashevsky

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.