How to install and use the Windows 10 SSH feature

Linux offers SSH directly via the Bash interface, and now you can do the same for Windows 10! Why do this? Putty makes it hard to initiate new server connections via the CLI and thus limits automation capability. Having SSH installed on Windows makes this task super straightforward. This post will show you how to install and use the Windows 10 SSH feature.

YouTube player

How to install the Windows 10 SSH feature

You can install the SSH feature using the Optional Features in Windows Settings or Windows PowerShell. However, either of these options will require elevated Administrator permissions.

To install SSH: click on Start -> Settings Apps -> Apps and Features -> Manage Optional Features. Next, find “OpenSSH Client” and then click “Install“.

Alternatively, you can run the following command via PowerShell to install SSH:

Add-WindowsCapability -Online -Name OpenSSH.Client*

See the following example screenshot:

PowerShell Add Windows Capability OpenSSH
PowerShell Add Windows Capability OpenSSH

How to use the Windows 10 SSH feature

Run the ssh command to see all the parameters that you can run.

PowerShell Run SSH
PowerShell Run SSH

Additionally, you should now be able to run a basic SSH command such as:

ssh username@servername

The first connection to a server will result in a message like the following:

The authenticity of host 'server name (<the server ip>)' can't be established.
ECDSA key fingerprint is SHA256:(<a large string>).
Are you sure you want to continue connecting (yes/no)?

Answer “yes” so that SSH will add the server to the local system’s list of known SSH hosts.

Of course, most of you may be using private key files instead of passwords. The easiest way to do this is by storing your private key file in the .ssh folder of your user profile.

You can then connect to your server using the following example command:

PS C:\Users\user> ssh -i ./.ssh/myPrivateKey.pem [email protected] -p 22

Remember to run PowerShell as your local Windows user for the example mentioned above.

Consequently, you will also have access to the following SSH commands from your Windows command prompt or PowerShell: ssh.exe, scp.exe, sftp.exe, ssh-add.exe, ssh-agent.exe, ssh-keygen.exe, and ssh-keyscan.exe.

Wrapping up

Now you know how to install and use the Windows 10 SSH feature! Tell Anto Online if you prefer using Putty or how it stacks up with Linux’s SSH client. You may also be interested to see “How to setup Windows Subsystem for Linux“.

Sources

You may also want to visit the following excellent sources for more in-depth information:

You may also be interested in

About Anto Online

Anto, a seasoned technologist with over two decades of experience, has traversed the tech landscape from Desktop Support Engineer to enterprise application consultant, specializing in AWS serverless technologies. He guides clients in leveraging serverless solutions while passionately exploring cutting-edge cloud concepts beyond his daily work. Anto's dedication to continuous learning, experimentation, and collaboration makes him a true inspiration, igniting others' interest in the transformative power of cloud computing.

View all posts by Anto Online

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.