Install and configure OpenSSH client and server on Windows 10

Install and configure OpenSSH client and server on Windows 10

The SSH (Secure Shell) protocol works by authenticating a remote user and transferring entries from the client to the host. It then forwards the output to the client – communication is encrypted, so security is much higher than Telnet. In this article, we will illustrate how to install and configure both the OpenSSH client and server on Windows 10.

Install and configure the OpenSSH client and server

To get started, first check the installation of the OpenSSH client.

  1. Launch the settings app by pressing the Windows key + I combo.
  2. In the Settings app, select applications sub-category.
  3. On the right side of the Applications and features window click on the Optional features link.
  4. In the next window that opens, scroll down to locate OpenSSH client. If the client is already installed, no user interaction is required – otherwise, just click the install button.

Once done, the next action is to add / install the OpenSSH server on Windows 10

Still in the Optional features window – at the top, click Add a feature.

Now scroll down and select OpenSSH server. Click on the Install and wait a few seconds while the feature is installed.

When the action is complete, restart the computer to confirm the changes.

The SSH client and server are now installed.

You must now configure the SSH server to start every time Windows 10 starts. Here's how:

Press the Windows key + R. In the Run dialog type services.msc, press Enter.

Then scroll down and double-click one after the other – SSH OpenSSH Server and OpenSSH Authentication Agent – and define the Startup type at Automatic.

Click on Apply > D & #39; agreement.

Side note: You cannot see the OpenSSH SSH server listed. This means that the previous action to add the functionality failed. In this case, you can install the functionality via the command line. Here's how:

Open an elevated command prompt. Copy and paste the command below and press Enter to find out the exact name of the feature / feature and if it is present in your system as it is hidden.

dism /online /get-capabilities | findstr /i "OpenSSH.Server"

Once this runs successfully, copy and paste the command below and press Enter to install the functionality:

dism /online /Add-Capability /CapabilityName:OpenSSH.Server~~~~0.0.1.0

You don't need to restart your PC – just click on the action in the Services window and click Refresh. The OpenSSH SSH Server function will be listed.

Now it is necessary to check if the SSH services are active. Here's how:

Right-click on Start and select Windows PowerShell (Admin).

In the PowerShell window, copy and paste the command below and press Enter-

Get-Service -Name *ssh*

You will get the following result:

Next, you will need to configure Windows Firewall to access your computer via SSH. To do this, always, in the PowerShell window, copy and paste the command below and press Enter.

.netsh advfirewall firewall add rule name="SSHD Port" dir=in action=allow protocol=TCP localport=22

You can now test if the SSH server is listening on port 22. To do this, always, in the PowerShell window, copy and paste the command below and press Enter.

.netstat -bano | .more.com

You will get the following result:

Point: If you do not see port 22 listed, restart your PC and at startup, rerun the command.

In the future, you can now connect remotely to an SSH server. To successfully establish a connection, the following parameters are required:

  1. Username
  2. User password
  3. Server IP address
  4. Port on which the SSH server is listening. In this case, the port is 22.

To establish a connection to the OpenSSH server – launch PowerShell, according to your own parameters, type the command below and press Enter.

ssh -p 22 [email protected]

Here, don't forget to use your personal information.

Then type the password and press Enter again to access the remote computer – and you will have access via PowerShell to the SSH server. This way your data stays safe from potential threat actors.

That's it for setting up a secure connection using OpenSSH in Windows 10.

Leave a Reply