Friday, December 27, 2024
Google search engine
HomeGuest BlogsConfigure OpenSSH Server on Windows Server 2019

Configure OpenSSH Server on Windows Server 2019

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

If you are from the world of Linux and because of one reason or another you currently find yourself in a situation where Windows 2019 servers are all over around you, there is good news for you. We know you are used to using SSH to log in and administer your servers and here you are in a different environment altogether. While there are Powershell options for logging into remote Windows Servers, most admins from a Linux background can find it hard to adapt.

Windows Server 2019 and the most recent version of Windows 10 come with the capability of installing SSH client and an SSH server. Now it is possible to just use your favorite ssh client instead of RDP or Windows Subsystem for Linux. This is very good news.

Let us not waste more time and proceed to install OpenSSH Server. Make sure your Windows Server has internet access for the OpenSSH Server part.

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

Step 1: Open Settings

Click on “Start” button and select Settings. It should be the gear icon.

ssh start settings

Step 2: Apps

After settings is fired up, select “Apps” then click on “Manage optional features

ssh step 2 Apps
ssh step 3 manage optional features

Step 3: Choose OpenSSH Server

You should see “OpenSSH Server” under “Add a feature“. Click on it and then click on “Install

ssh step 4 Add feature
ssh step 5 openssh server install

Step 4: Start Server and change start-up policy

Open “Services” applications by clicking on the “Windows” button and search for “Services“. Once it is open look for OpenSSH Server, right-click and select properties. A new pop-up window will open. In it, change the start-up to Automatic from the drop-down as shown in the illustrations below and then start the server.

ssh step 5.1 open services
ssh step 5.2 Openssh server shown in services

Right-click OpenSSH Server and select properties

ssh step 5.3 right click openssh server in services

Change the start-up to Automatic, “Start” the Server and click “OK

ssh step 5.4 openssh server properties window

Step 5: Allow port 22 in firewall

If your firewall is on in your server, allow TCP Port 22 so that clients can be able to connect to the server. Follow How To open a port in Windows Server Firewall guide for that only changing the port to 22.

Step 6: Install SSH Client on Windows

Install using PowerShell

You can otherwise install the OpenSSH Server and client by running the following commands in Powershell. Open your Powershell with Administrator privileges and run the commands.

ssh powershell right click run as admin

Commands to run in PowerShell

## Install  OpenSSH.Server 
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

## Install  OpenSSH.Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

## Change server start-up to Automatic 
Set-Service -Name sshd -StartupType ‘Automatic’ 

## Start the Server and change start-up to Automatic
Start-Service sshd

Step 8: Testing OpenSSH Server

Use the SSH Client to connect to SSH Server as shown below. AS you can see, we are on a server with IP 10.10.20.2 and we are “sshing” to 10.10.20.21. Input “yes” and key in the password of the account.

ssh powershell test

And we are in..

ssh powershell test logged in 1

Conclusion

We have successfully managed to install and Configure OpenSSH Server and Client. Thank you for reading through.

Also read:

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments