How to Install an OpenSSH Server/Client on A Windows 2016 Server

Installing an OpenSSH server/client on a Windows 2016 server arms the user with a multi-function set of client/server utilities that facilitate a secure environment when logging into or transferring files to your windows server remotely. It also serves as a security management tool for your public/private key pairs. To install OpenSSH, use the following procedure:

Note: To make the following changes, you must be logged in as SYSTEM or Administrator. If you are installing OpenSSH with Powershell, make sure to launch Powershell as an Administrator.

Installing OpenSSH

  1. From, download the latest .zip of OpenSSH. The typical choice for Windows 2016 is to download the [] option.
  2. Extract the file and save it on your console. The easiest way to find it locally would be to save it in your [C:\Program Files\].
  3. Open your console’s Control Panel. In the System and Security section, open up System. Click on Advanced System Settings and, in the System Properties dialog box, click Environmental Variables.
  4. In the System Variables section on the bottom half of the dialog, select Path. Click Edit….
  5. Click New. Add the OpenSSH folder path. After you have added the folder, you may now close the System Properties> dialog.
  6. >Run Powershell as an Administrator. Enter the OpenSSH folder path in the appropriate field.  To install OpenSSH, run the '.\install-sshd.ps1' command. If the line “sshd and ssh-agent services successfully installed” appears, installation was successful.
  7. To generate a host key, run the '.\ssh-keygen.exe -A' command.
  8. Reopen your Control Panel and click on Administrative Service/Administrative Tools. In the resulting dialog, click Services. Find ‘sshd’ in the list and change the startup type to Automatic. Then, run sshd.

Altering Windows Firewall Settings to Allow SSH Connection

If Windows firewall is running, you may have trouble connecting SSHD to your Windows server. Use the following procedure to change Windows firewall settings to ensure the SSH can connect properly:

  1. In your Control Panel, click System Security and then click on Windows Firewall. Click on Advanced Settings in the panel on the left side of the dialog box.
  2. In the Windows Firewall With Advanced Security dialog, select Inbound Rules from the menu to the left. Select New Rule from the menu on the right.
  3. This will open the New Inbound Rule Wizard dialog. When the New Inbound Rule Wizard dialog opens, select Protocol and Ports from the menu on the left of the dialog. Select the Custom option and click Next.
  4. In the Program section, select All Programs.
  5. Finally, in the Protocols and Ports section, select TCP and enter ‘22’ in the Specific local ports box. Finish and exit the New Inbound Rule Wizard

You have now successfully ensured that your SSH setup can connect to the Windows server.

Special Note: Windows hosting has a reputation for being costly, but that doesn't have to be the case. Visit our Best Windows hosting reviews page to find the best deals from the top windows hosting providers.

Check out the top 3 Windows hosting services:

Was this article helpful?