OpenSSH Client on Windows 10

Posted by High Harmonics Validators on March 03, 2022 · 3 mins read

OpenSSH Client on Windows 10

Why use OpenSSH instead putty or WinSCP?

OpenSSH is a modern tool which works out of the box with most of the servers. Once installed on your PC, creating and managing the keys are just a couple is done easily without opening windows or clicking around. Furthermore OpenSSH provides you with the functionality of both tools combined, i.e. the private-public key pair via ssh-keygen and the secure copy function via scp.

“OpenSSH is the de facto standard implementation of the SSH protocol. If PuTTY and OpenSSH differ, PuTTY is the one that’s incompatible.

If you generate a key with OpenSSH using ssh-keygen with the default options, it will work with virtually every server out there. A server that doesn’t accept such a key would be antique, using a different implementation of SSH, or configured in a weird restrictive way.

PuTTY uses a different key file format. It comes with tools to convert between its own .ppk format and the format of OpenSSH.” [1]

Installation Process

Step 0

The OpenSSH Client and Server is available on Windows 10 with a build higher than 1809. To check the version, open the Windows commandline cmd.exe

Step 1

  • Press WIN+ R to open the Run window.
  • Type the command ms-settings:optionalfeatures inside the Open: box and press ENTER

Step 2

The above command will open the Optional features window

  • Search the list of Installed features for OpenSSH to see if it is installed already

  • If not installed, click on Add a feature inside the box
  • here you type openssh in the Search box and press ENTER
  • Select OpenSSH Client in the results
  • Click Install button to get the OpenSSH installed on your machine

drawing

After the installation is done you can verify it by typing the following in the terminal.

where ssh

you should see the following output

C:\Windows\System32\OpenSSH\ssh.exe

Congratulations 🎉🎉🎉 now the OpenSSH is installed on your machine! In the next subsection we will generate ssh keys.

Generating Public-Private Key Pair

In order to generate a public-private key pair we use the following command

ssh-keygen

which will give the following output

Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\HighHarmonics\.ssh\id_rsa)

Leave the default path as it is. Your username would be a different one, off course. It may also ask you for a password for the key pair. You can go ahead without it.

Accessing the Public Key

To get your Public key, you can use the following command

cat C:\Users\HighHarmonics\.ssh\id_rsa.pub

which will produce something like the following

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxZzrJ8qK80LxvxcPxJZPtJvPwpmbO9tXnj3U7GdCdpcHEKlQGlSv0ok/ZvruiBenfUQgrmcy41Ku8qC+pZr0ZRe/26q9M34cN6Omec3rWsizVPumppudmFwzkNUi6dUytOP2KTURRw6cOaZU/yA2iaDQZiVaAQxqklrvuy5wmh5Z3f5Kzj1sJB59LVvQNcvv6CthL5U8/NJ/usnPWpQUjy1CcLht60XcSm7SIQTZN3j9wNJQfhQV+UT9VjwMygqDlDOM2SyJoyjpc4cShqkGNPAHv3dUOjeMKIfePvNqgmunKViiaLPNfJRc+6wSswLP/f3oxG3NwBDtUFgZr5zADyQCMUfJ43DhoGfSHDGJCZxKOgikjNdqD2CpBgbMt4iv4gfOWupVInL4ylO7k9Y1zFoUZAT0yxPGwdUOVIUJOYVPhXaokRm/O+4AcUxbUnj02MkCll60bm3rUR1LX855uQkwgJuV4ojCGeNmKfy/21htZLe0NY0T95yL50taUcR9XOtzFQ4cStlcbZiilLXkhzhaPs2HCBd4OvI7PDtDJsqbAxKBKecKQPOLJEYfndKQkLdfITF441tN52eHiRbBbasRtP5eu7BtPKnuLFt2/Wv39Bl+/GLTPZZbkjnIkfMojSs9+LzeE6HjNO8l24WsJLwT73t5nOj8xU5U9XM/zUgw==highharmonics@MacBuntu

You can copy this output and paste to trusted keys on the server side.


REFERENCES

[ 1 ] stack exchange

Medium Version