How to install OpenSSH on Windows Cloud Servers

2022-05-31 By Nathan 5557 Views windows openssh
6 reviews

OpenSSH stands for open-source SSH protocol implementation. It is free and open-source as it can be customized. The connection established via OpenSSH will be encrypted which provides security aspects, eliminating hijacking, sniffing, eavesdropping and other network attacks.


The tutorial describes simple steps to install OpenSSH on Windows Server 2022. The following steps are to be performed prior to the installation steps.


Installation of OpenSSH


  1. Go to start menu and type Optional Features in the search option.

    opensshwindows1

  2. Click on Add a feature and enter the OpenSSH in the search box, select the same.

    opensshwindows2

  3. Select the OpenSSH Server and proceed to click Install.

    opensshwindows3

  4. The progress bar shows Installed and can conclude the OpenSSH server has been installed in the server, as it will be available in Installed Features.

    opensshwindows4


To install OpenSSH using Windows PowerShell


  1. Open the Windows PowerShell as Administrator.

    opensshwindows5

  2. Run the following commands to install OpenSSH Server as well as OpenSSH client.

    Add-WindowsCapability -Online -Name OpenSSH.Server

    Add-WindowsCapability -Online -Name OpenSSH.Client

    opensshwindows6


Firewall configuration for OpenSSH after installation

To customize the Installation configuration, you would require to edit the configuration file in the file C:\Programdata\ssh\sshd_config.


The following steps are to be done in order to configure the SSH port to be allowed into the Windows firewall.

  1. Select Windows Defender Firewall with Advanced security from Server Manager.

    opensshwindows7

  2. To allow incoming connections, Click Inbound Rules in the Firewall window and select a new rule, select Port and click Next.

    opensshwindows8

  3. Select the protocol which is TCP and the specific local ports section, and enter 22 as the OpenSSH port number is 22.

    opensshwindows9

  4. Select Allow the connection option to proceed further, and click on Next.

    opensshwindows10

  5. Here we specify when this rule applies. Select them and proceed further.

    opensshwindows11

  6. Finally the rule name and description specified, click Finish.

    opensshwindows12


    The above will add the firewall rule for incoming SSH connections and now you may test it.

    Once done, you would require to start the SSH.

    Start-service sshd

    opensshwindows13

    Now, you may attempt to take SSH access to the Windows server using the command format:

    ssh -l Administrator < server-ip >


    NOTE: Replace SERVER IP with your real IP


    It will prompt for a password, once entering you would be able to get the output as below:

    opensshwindows14


Related Tutorials

What do you think about this article?

Rate this article
LayerStack Promotion
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.