How to enable SSH in Windows Server 2019

0
176

Hey, what’s up? This time we’re going to talk about enabling SSH on Windows Server 2019. In the previous post, we have talked about different protocols of remote connection via terminal. In fact, we saw how to enable Telnet and SSH in Windows 10 and Windows Server 2016/2019. The security advantage offered by SSH over Telnet was also established. As we have seen, the implementation of the SSH protocol in Windows 10 provides a security advantage. Now, we will see how to enable SSH on Windows Server 2019.

Install SSH Server on Windows Server 2019

The first thing you have to do is open a PowerShell with administrative privileges. To do this, press the Win+X combination, then add the following command:

 Get-WindowsCapability -Online -Name Open* 

As you can see, the OpenSSH Client and OpenSSH Server packages are available for installation.

OpenSSH Client and OpenSSH Server packages, available for installation.
OpenSSH Client and OpenSSH Server packages, available for installation.

Next, we’re going to install the SSH client. With this intention please type the following command in a PowerShell with administrative privileges:

 Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 
Installing the SSH server
Installing the SSH server

Check the operation of the SSH server.

To check the status of the SSH server installation, run the following commands:

 Get-Service sshd 
 Get-Service ssh-agent 
Checking SSH server status
Checking SSH server status

As you can see, the service is stopped. So before you start them, you need to enable them to start with Windows startup. With that intention write the following in the PowerShell:

 Start-Service sshd 
 Start-Service ssh-agent 
Starting SSH server services
Starting SSH server services

Testing the SSH server

Once the OpenSSH server is installed and configured in Windows Server, you only need to test it. If you want to know how to use an SSH client in Windows 10, please check here. Consequently, you only have to open a console from Windows 10 or any device with an SSH client and type the following:

 ssh administrator@PMserver

Please keep in mind that after the at you must type the name of the server you want to connect to. A warning window will appear, where you have to type Yes and then press Enter. Now, enter the password corresponding to the administrator user.

Connecting to the SSH server
Connecting to the SSH server

After entering the password, the connection is successfully established. Now you can enter any command as if it were physically in front of the server.

OpenSSH client running the command view
OpenSSH client running the command view

Installing the SSH client on Windows Server 2019.

After configuring the OpenSSH server, we will enable the SSH client. Consequently, we will be able to connect to another SSH server from our Windows Server computer. With this intention, type the following command in a PowerShell with administrative privileges:

 Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Enabling the OpenSSH client on Windows Server
Enabling the OpenSSH client on Windows Server

To test the functioning of the client, just type SSH.

Testing SSH Client Functioning
Testing SSH Client Functioning

Using the OpenSSH client

Next, let’s test the connection by opening a cmd and entering the ssh command, followed by the user name, the @ and the IP address of the server. Then, add the user’s password and press enter.

ssh coolr@192.168.X.XX
Add the user name, IP address and password -
Add the user name, IP address and password –

Finally, we access a remote computer using the SSH protocol.

OpenSSH client running the DIR command.
OpenSSH client running the DIR command.

Finally, we have seen how to enable a client and an SSH server in Windows Server. Under those circumstances, it is now possible to connect to any OpenSSH server. It is also possible to remotely access our server using this technology. That’s all for now, I hope you enjoyed this tutorial.

LEAVE A REPLY

Please enter your comment!
Please enter your name here