Windows 10 SSH (OpenSSH) Tutorial

SSH is a secure remote management protocol used in different operating systems and platforms like Linux, Ubuntu, CentOS, Cisco, etc. The OpenSSH is an implementation of the SSH protocol. Different products are used for SSH servers and clients in Windows but all of them were 3rd party and do not come with Windows as built-in. In autumn 2018 the SSH supported added to the Windows 10 and Windows Server 2019.

OpenSSH Tools

OpenSSH project provides the following tools in order to make SSH connections.

  • sshd.exe is the SSH daemon or SSH service which runs over the TCP 22.
  • ssh.exe is the SSH client tool used to connect remote SSH server.
  • ssh-keygen.exe is used to generate SSH keys for authentication and security.
  • ssh-agent.exe is used to store, manage, and provide the SSH keys.
  • ssh-add.exe adds private keys to the list allowed by the server.
  • ssh-keyscan.exe is used to scan the SSH server’s public server keys which are used for SSH server authentication.
  • sftp.exe is used for secure file transfer over the Secure File Transfer Protocol.
  • scp.exe is used for secure file transfer over the SSH.

Install/Enable SSH Server For Windows 10 and Windows Server 2019

The SSH server and SSH client is provided with the Windows 10 and Windows Server 2019 as built-in. They can be installed or enabled by using the Windows Features. The installation or enabling is explained in the following post in detail.

Connect with ssh Command

After the SSH client is installed we can connect to the remote SSH server by using the ssh command. Actually the ssh command is the ssh.exe. The ssh command can be used for both MS-DOS (cmd.exe) or PowerShell command line interface.

ssh
SSH Command In MS-DOS
SSH Command In PowerShell

In order to connect to the remote system, we will provide the IP address of the remote system we want to connect to.

ssh 192.168.10.10

The username of the remote system can be provided before the remote system IP address or hostname. The @ sign is used to separate the username and remote system.

ssh [email protected]
Connect SSH Server via PowerShell ssh.exe

Alternatively, the remote system hostname can be used for the SSH connection. But the domain name should be resolved into the IP address.

ssh dc.windowstect.com

SSH server work on TCP 22 port number by default. And the ssh client command uses this port implicitly without the need to specify it. But if the remote SSH server port is different than the default TCP 22 port number we can specify the SSH port number with the -p parameter.

ssh -p 2222 192.168.10.10

Connect with PuTTY (GUI)

The PuTTY is an SSH tool that is created for Windows operating systems even it is provided for Linux too. PuTTY provides a GUI for the SSH configuration. The PuTTY can be downloaded from the following link. The PuTTY project provides a lot of helper tools where most of them explained at the beginning of this post.

READ  PowerShell Get-Date Command Tutorial

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

The MSI installer of the PuTTY and related tool can be downloaded with the following link. This can be installed with Next and Next clicking.

https://the.earth.li/~sgtatham/putty/latest/w64/putty-64bit-0.74-installer.msi

Put the following information into the PuTTY main screen and save them.

  • Host Name (or IP address) provides the remote hostname or IP address and optionally the username.
  • Saved Sessions is the name for naming this SSH configuration.
  • Click to the Save button.
PuTTY for SSH Windows

For the first time SSH connection following “Security Alert” is printed to the screen where simply click to the “Yes” button.

Accept SSH Server FingerPrint

When the SSH connection established the user password is requested. After putting the user password the SSH command line interface or shell is displayed like below.

PuTTY SSH Shell

Leave a Comment