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 Window 10! Why do this? Well, 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.

How to install the Windows 10 SSH feature

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

To install SSH: click on Start -> Settings Apps -> Apps and Features -> Manage Optional Features. Next locate “OpenSSH Client“, 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

You should now be able to run: ssh, 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 similar to 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.

Off 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 ubuntu@192.168.0.100 -p 22

For the example mentioned above, remember run PowerShell as you local Windows user.

You will consequently also have access to the followings 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.

In Conclusion

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:



About the Authors

Each member of Anto's editorial team is a Cloud expert in their own right. Anto Online takes great pride in helping fellow Cloud enthusiasts. Let us know if you have an excellent idea for the next topic!

Support the Cause

Support Anto Online and buy us a coffee. Anything is possible with coffee and code.

Buy me a coffee



Leave a Reply

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