6 C
Texas

How to install an SSH client and server in Windows 10.

Hello, how are you? In the previous article, we saw how to enable Telnet in Windows Server. This protocol is very useful, but it has a serious security breach. For that reason, we recommend using the SSH connection. It is a remote administration protocol that allows users to control and modify their remote servers over the Internet. To do this, it uses an authentication mechanism. The protocol works by authenticating a remote user and transferring inputs from the client to the host. It then retransmits the output back to the client. But most importantly, the communication is delivered encrypted so the security is much higher than Telnet. In view of the above, let’s see how to install an SSH client and server in Windows 10.

Prerequisite

In order to enjoy all the benefits of this protocol, it is necessary to have a Windows version equal to or greater than 1803.

Installing the SSH client

First, let’s verify the SSH client installation. With this intention, enter in Windows Settings pressing the combination Win+I. Once there, select Apps

Entering the Apps section
Entering the Apps section

Then click on Optional features.

Select optional features
Select optional features
- Advertisement -

In the next window, you will see all the optional functions. Then scroll down to find the OpenSSH Client. In this case, the client is already installed, so there is nothing else to do. In case it is not, just click on the install button.

Installing the SSH client
Installing the SSH client

Add SSH server in Windows 10

From the previous screen please click on Add a feature:

Adding Features
Adding Features

Now scroll down and select OpenSSH Server. Press install and wait a few seconds while the function is installed. Once the action is executed, please restart the computer to confirm the changes.

Install the OpenSSH server
Install the OpenSSH server

Configure OpenSSH Server to start with Windows.

From now on the client and the SSH server are installed. For the SSH server to be activated every time we start Windows we will have to do the following. Press the Win+R combination and run services.msc

Run services.msc
Run services.msc

Then scroll down and select OpenSSH SSH Server and OpenSSH Authentication Agent:

Select the two SSH services
Select the two SSH services

Now what we are going to do is to activate them so that they start every time you start Windows. With that intention double-click on OpenSSH Authentication Agent and in the startup type select Automatic. Then press Apply and finally accept.

Setting the automatic startup of OpenSSH Authentication Agent
Setting the automatic startup of OpenSSH Authentication Agent

We will repeat this procedure with the OpenSHH SSH Server Service

Setting the automatic startup of OpenSHH SSH Server
Setting the automatic startup of OpenSHH SSH Server

As we did in the previous step, restart the computer to set the changes. With these steps, we will be able to install the server and the SSH client in Windows 10.

Testing the SSH client and server

After restarting the computer, it is necessary to verify if the SSH services are active. To do this, open a PowerShell as administrator by pressing the Win+X combination.

Runs a PowerShell as administrator.
Runs a PowerShell as administrator.

Then execute the following command:

 Get-Service -Name *ssh* 

If all goes well, you will see the next result in the PowerShell, showing the two services running:

Configuring the Windows firewall

In order to have access to our computer through SSH we have to configure the Windows Firewall. To do this we open a PowerShell as administrator and execute the following command:

.\netsh advfirewall firewall add rule name="SSHD Port" dir=in action=allow protocol=TCP localport=22 
Opening port 22 to allow SSH connections:
Opening port 22 to allow SSH connections:

It then tests whether the SSH server is listening on port 22. For this purpose, from a PowerShell with administrator privileges runs the following command:

.\netstat -bano | .\more.com

Connect to an SSH server from Windows.

From now on we can connect remotely to an SSH server. To execute it, it is necessary to know 3 parameters:

  • User name
  • Server IP Address
  • Know the port where the SSH server is listening. In this case, the port is 22.
  • User password

Once this data is known, open a PowerShell and run the following command:

 ssh -p 22 [email protected]

Then add the password to access the remote computer. And you will have access via PowerShell to the SSH server.

Accessing an SSH server from the Windows 10 PowerShell.
Accessing an SSH server from the Windows 10 PowerShell.

Conclusion

Finally, we have seen how to install an SSH client and server in Windows 10. This way we will be able to remotely manage any device that uses this protocol. Additionally, security is increased because the communication between host and client is encrypted. In this way, our data remains safe from possible attackers. This is all for the moments, before saying goodbye I want to invite you to see our post about Telnet in Windows Server.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article