Installing OpenSSH on Windows 10 (1803 and higher) and Server 2019. Ssh server Windows 10

installing, openssh, windows, 1803

Connecting to a Remote Server Over SSH on Windows

Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.

A secure shell (SSH) is used for secure communication between devices. When most people refer to SSH, it is within the context of connecting from a local computer to a remote server, commonly for administration tasks related to website hosting.

This article walks you through how to use SSH from Windows, covering the basics of installing a Windows SSH command-line tool and connecting to a remote server (such as a Linode) over SSH on a local Windows system.

Open the Terminal

On your local Windows computer, open the terminal application you wish to use. The terminal allows you to access your operating system’s shell environment and run programs through the command line, such as the SSH command.

  • Command Prompt (or PowerShell). Windows 10 or 11: This is the easiest method for most people using Windows 10 or later.
  • Windows Subsystem for Linux. Windows 10 or 11: This requires quite a few more installation and configuration steps, but may be a better option for those who prefer working within a Linux command-line.
  • PuTTY. Windows 8, 7, Vista, and XP: For earlier versions of Windows, you need to use PuTTY or any other third-party terminal emulator.

Command Prompt (or PowerShell). Windows 10 or 11

There are two terminals on Windows 10 and 11, the Command Prompt (also called CMD) and PowerShell. To connect to a server using SSH on Windows 10 within one of these tools, the OpenSSH client needs to be installed. OpenSSH is a Windows SSH client and available on newer versions of Windows 10 (April 2018 update and later), though it may need to be manually enabled.

Install the OpenSSH Client

  • Open up Windows Search by selecting the search area (or search button) on the taskbar or by pressing Windows S on the keyboard.
  • Start typing “Manage optional features” and select Manage optional features (System settings) from the search results.
  • The Optional features page of the Settings application launches. Under the Installed features list, look for the OpenSSH Client feature.
  • If the OpenSSH Client feature is not installed, click the Add a feature button at the top of the page. A dropdown menu appears. Select OpenSSH Client and press the Install button to install the ssh on Windows.

Open the Command Prompt or PowerShell

To run the SSH command, you first need to open your preferred command line utility. Open Windows Search through the Windows S hotkey, type “Command Prompt” or “PowerShell” into the search area, and select the corresponding application from the results. PowerShell 7 or later, the newer cross-platform PowerShell application, can also be used if installed.

Windows Subsystem for Linux (WSL). Windows 10 or 11

Instead of using the Command Prompt or PowerShell environment (which is significantly different than both the macOS and Linux command-line environments), you can run Linux directly within Windows through WSL (Windows Subsystem for Linux). This may be preferred if you are more comfortable working within a Linux shell environment.

  • Install WSL by following the instructions within Microsoft’s Install WSL guide. If you already have WSL1 installed, it’s recommended to update to WSL2.
  • Install your preferred Linux distribution, such as Ubuntu, directly from the Microsoft Store. A full list of available distributions can be found under Step 6. Install your Linux distribution of choice of the previously mentioned guide.

Once everything has been configured, you can use the WSL environment by opening your installed Linux distribution through the Start Menu or Windows Search. By default, WSL uses a fairly basic terminal emulator. You can also use a more customizable terminal, such as Windows Terminal or Hyper.

PuTTY. Windows 8, 7, Vista, and XP

There is no native SSH client in Windows 8 and earlier. Instead, you’ll need to use a third party application, such as PuTTY, Cygwin, the Secure Shell extension for Google Chrome, or any other SSH-enabled terminal emulator:

Connecting to the Remote Server Over SSH from Windows

Once you’ve opened your preferred Windows SSH client (Command Prompt, PowerShell, or WSL), you can run the ssh command to connect to your server.

    Within the terminal, enter the following command, replacing [username] with the username of the remote user and [ip-address] with the IP address or domain name of the remote server.

If the server’s SSH port is something other than 22, it needs to be specified in the SSH command. To do this, use the.p option as shown in the command below. Replace [port-number] with the port number that the remote SSH server is using.

The authenticity of host ‘ (’ can’t be established. ECDSA key fingerprint is SHA256:d029f87e3d80f8fd9b1be67c7426b4cc1ff47b4a9d0a84. Are you sure you want to continue connecting (yes/no)?
Warning: Permanently added ‘example’ (ECDSA) to the list of known hosts.

Once you have successfully connected, your terminal should be using the remote shell environment for the server. Your command prompt should now show the username and hostname configured for the server. You can now run any commands that you have available on that server. This includes many of the basic Linux commands, such as ls. cd. rm. and those covered in Using the Terminal guide. Getting to know these commands will help you navigate around your server.

Ending the SSH Session

After you are done, log out of the session by typing exit. The terminal then shows something similar to:

logout Connection to closed.

At this point, the shell prompt returns to the one for the local workstation and the terminal application can be closed if it’s no longer needed.

Sending Commands Over SSH

Instead of using SSH to open your remote server’s console, you can run commands on your server without leaving your local shell environment. This can enable you to quickly run commands both locally and remotely in the same terminal window.

Sending a Single Command

To run a single command on your remote server, use the following command. Replace [username] with the username of the remote user, [ip-address] with the IP address or domain name of the remote server, and [command] with the command you wish to run.

As an example, running ssh me@ ls lists all the files in the home directory of the user called me. This can be useful to find the uptime of the server ( ssh me@ uptime ) or maybe determine its Linux distribution and version ( ssh me@ lsb_release.a ).

Sending Multiple Commands

To run multiple commands on your remote server (one after the other), use the following command. Replace [command-1], [command-2], and [command-3] with the commands you wish to run.

The commands should be separated by a semi-colon ( ; ) and all of the commands together should be surrounded by double quotation marks ( ” ). For example, if you wanted to create a file named bar.txt in a directory called foo within the user me’s home directory, run: ssh me@ “mkdir foo; cd foo; touch bar.txt”.

installing, openssh, windows, 1803

Using sudo

It’s recommended to disable root access over SSH and only log in to your remote server through a limited user account. However, some commands require elevated privileges, which can usually be accomplished by prepending the command with sudo. If you attempt to do this while running commands directly through the SSH command, you may receive an error such as “no tty present” or there isn’t a “stable CLI interface”. To run the sudo command in these instances, use the.t option, which forces a psuedo-terminal allocation. For example, to update your packages on a Debian-based system, run ssh “sudo apt update”.

Going Further

Troubleshooting SSH Connection Issues

If SSH isn’t connecting you to your Linode, you may need to investigate the state of your server. See the guide Troubleshooting SSH for assistance.

Increasing Security

  • Now that you can connect from your Linux machine to the Linode over SSH, save not only time but also make the connection even more secure by using SSH public key authentication. For more information, see SSH add keys.
  • See the “Harden SSH Access” section of Setting Up and Securing a Compute Instance guide to review how to secure SSH on the server’s side, and the Advanced SSH Server Security for more information on making it even more secure.

This page was originally published on Friday, June 25, 2021.

Installing OpenSSH on Windows 10 (1803 and higher) and Server 2019

Windows Server 2019 includes OpenSSH as an optional feature for the first time, thus simplifying installation and configuration. However, errors in earlier builds of the operating system prevent a successful activation of the Secure Shell (SSH) server. In Windows Server Update Services (WSUS) environments, OpenSSH has the same problems as Remote Server Administration Tools (RSAT).

Wolfgang Sommergut has over 20 years of experience in IT journalism. He has also worked as a system administrator and as a tech consultant. Today he runs the German publication

By porting OpenSSH to Windows, Microsoft made it easier to manage heterogeneous environments. You can remotely administer Linux computers via SSH from Windows, and thanks to the new OpenSSH server, the reverse is now also possible. In addition, PowerShell Core supports remoting via SSH, even between different OSes.

OpenSSH server is not included in the operating system

One would expect that a system component with such strategic importance is delivered as part of the operating system and can be installed as a feature via the Server Manager or PowerShell.

However, Microsoft has decided to provide OpenSSH as an optional feature (also called a “Feature on Demand”). This unifies the installation between the client and server OSes. The following description therefore also applies to Windows 10 from release 1803 onwards.

Installation via the GUI

To install OpenSSH server, start Settings and then go to Apps Apps and Features Manage Optional Features. As you can see from the list of installed components, the SSH client is already installed by default. The server, on the other hand, you need to add using the Add Features option.

Installing the OpenSSH server via the Settings app

In the list above, select OpenSSH server and click on the Install button that appears. Windows will now download the required files over the internet. If an error occurs, you will not receive a message from the Settings app, but it will simply jump back to the list of features.

Adding an OpenSSH server via PowerShell

In contrast, PowerShell provides more transparency. To find the exact name of the required package, enter the following command:

Get-WindowsCapability.Online | ? OpenSSH.Server

Finally, add the name shown to Add-WindowsCapability:

Adding an OpenSSH Server via PowerShell

Alternatively, you can pass on the output via a pipe:

Get-WindowsCapability.Online | ? OpenSSH.Server | Add-WindowsCapability.Online

Faulty builds

There are at least two reasons why you may encounter problems here. If the build of the system is older than 17763.194, you will see this error:

Add-WindowsCapability failed. Error code = 0x800f0950

The installation of OpenSSH server fails on earlier builds of Windows Server 2019.

In this case, you need a current cumulative update to fix the problem (documented here).

Problems with WSUS

A further hurdle arises if the server, which is usually the case, is updated via WSUS. Microsoft delivers features on demand bypassing WSUS, so you don’t get them via the internal update server.

Therefore, it is not unlikely that PowerShell will present the following error here:

Error with “Add-WindowsCapability”. Error code: 0x8024002e

Error while installing OpenSSH as an optional feature in WSUS environments

In the eventlog, you will then find an entry with ID 1001 stating that the OpenSSH-Server-Package is not available.

Eventlog entry when adding OpenSSH server as optional component in a WSUS environment

As with the RSAT, a remedy is to allow Windows to load optional features directly from Microsoft Update via group policy. This setting is “Specify settings for optional component installation and component repair,” and you can find it under Computer Configuration Policies Administrative Templates System.

Allowing WSUS clients to access Windows Update using Group Policy

At the same time, you must ensure that neither the setting “Do not connect to Windows Update Internet locations” nor “Remove access to use all Windows Update features” is in effect.

The latter may have been enabled to prevent users from manually downloading feature updates. This primarily affects Windows 10 rather than the server.

Activating SSH-Server

OpenSSH Server installs two services that are not yet running and whose startup type is manual and disabled. If you want to use SSH regularly, you will want to start the services automatically.

Displaying the startup type and status of SSH services with PowerShell

You can configure this via the GUI services, but the fastest way is by using PowerShell:

Set-Service sshd.StartupType Automatic Set-Service ssh-agent.StartupType Automatic

To put the SSH server into operation immediately, you must also start the two services manually:

Start-Service sshd Start-Service ssh-agent
Get-Service.Name ssh | select DisplayName, Status, StartType

checks if the settings for the two services are correct and whether they were started successfully. Now you can verify if the firewall rule for incoming SSH connections has been properly activated:

Get-NetFirewallRule.Name SSH

Checking the firewall rule for SSH

Testing the connection

If this condition is also fulfilled, the connection test is good to go. From a Windows 10 PC or a Linux computer, you can connect to the freshly configured server:

This will direct you at the old command prompt, but you can also start PowerShell there.

Subscribe to 4sysops newsletter!

Establish a connection to a freshly installed SSH server

Finally, you should consider whether you would like to use public key authentication for security reasons. This also increases user comfort because you no longer have to enter a password. This guide describes how to do this.

PowerShell SSH: How to Install SSH PowerShell on Windows 10/11 [Partition Magic]

Before you set up the SSH from PowerShell, let’s have an overall understanding of the following questions.

What Is SSH

SSH (Secure Shell) is a remote administration protocol that allows you to control and modify your servers over the internet. It is also a cryptographic network protocol that allows you to use network services safely even through an unsecured network. This is because it can create a secure connection to the shell on another computer.

installing, openssh, windows, 1803

With the SSH client, you can build communications from the remote server in an encrypted manner. For example, you can build a remote connection between Windows and Linux via SSH and transfer files between them. In addition, you can take full use of SSH clients like PuTTY on Windows.

What Does PowerShell SSH Mean

When it comes to managing a remote server or network service, the most common way is to use SSH in Windows PowerShell as an SSH client. This is because PowerShell comes with a built-in SSH client that allows you to connect securely to a remote server even through an unsecured network.

On Windows 10 v1809 and higher, the PowerShell SSH client is enabled by default. That’s to say, you can connect to a remote device via the PowerShell SSH command tool. But there are some prerequisites to using Windows SSH PowerShell.

Can I Use Windows PowerShell SSH

Can I use Windows PowerShell SSH? The answer depends on whether your computer has met the prerequisites. To use SSH in Windows PowerShell, make sure that you have:

  • Windows 10 v1809 and higher version (If you don’t know how to update Windows, you can refer to this post “How to Install Windows Updates with PowerShell”.)
  • PowerShell v6 and higher (To update PowerShell, read this post “How to Update PowerShell Version to v7.2.5 for Windows 10/11”.)
  • Open port 22 in your Firewall

If you don’t know how to use SSH Windows PowerShell, you can refer to the tutorial below:

Step 1. Type PowerShell in the search box, and then right-click the Windows PowerShell and select Run as administrator. Then click on Yes to confirm it.

Step 2. In the elevated PowerShell window, type ssh and press Enter to access Windows SSH PowerShell.

Step 3. With the SSH client opened, you can connect to a remote server or network device with the following PowerShell SSH command. For example, the command should be ssh [email protected] in my case.

If you don’t know the IP address of your host, you can refer to this post. Alternatively, you can use the hostname instead of the IP address. If you don’t supply the username, then it will use your local user account.

Step 4. If the SSH client is running on a different port rather than the default port 22, you can run the following command to change the port number.

Can PowerShell get folder size? How to get folder size PowerShell on Windows 10/11? This post discusses these questions in detail and introduces an alternative.

How to Install SSH PowerShell on Windows 10/11

As mentioned above, the SSH client has been installed and enabled by default on Windows 10 v1809 and higher, but the SSH server isn’t. So, you need to install the OpenSSH server first and then configure the SSH server. Here’s how:

For remote connection, make sure you have installed PowerShell v6 or higher on the computer. Here we take PowerShell v7.3.0 for example.

Step 1. Install OpenSSH Server with PowerShell.

Open the elevated PowerShell command as we explained above, type the following command, and hit Enter to check if the OpenSSH server is installed.

Get-WindowsCapability.Online | ? ‘OpenSSH’

If not installed, run the following command to enable the OpenSSH server in PowerShell.

Add-WindowsCapability.Online.Name OpenSSH.Server~~~~

Run the following command to start the OpenSSH server.

Step 2. Configure the SSH server on Windows.

In addition, you need to configure the SSH server so that you can use more PowerShell SSH commands on remote computers.

  • Navigate to the sshd_config file located at env:ProgramData\ssh and open it with Notepad.
  • In the configuration file, remove the “#” before the line PasswordAuthentication yes to make sure the password authentication is enabled.
  • Add the following line in the configuration file to create the SSH subsystem on the remote computer. Then press Ctrl S keys to save the changes.

Subsystem powershell c:/progra~1/powershell/7/pwsh.exe.sshs.NoLogo.NoProfile

  • Run the Restart-service sshd command in PowerShell to load the new configuration file.

After finishing all the above steps, you should get the PowerShell SSH server installed on Windows 10/11 and you can connect to it using PowerShell.

What can you do with the CMD ping test? How to ping from Command Prompt Windows 10/11? How to read the ping test results? Now, you can get the answers here.

Further reading : If you enter some issues like file system corruption and low disk space on Windows 10/11, don’t worry. MiniTool Partition Wizard can help you fix them easily by checking file system errors, extending/resizing partitions, analyzing disk space, upgrading to a larger hard disk, etc.

About The Author

Ariel has been working as a highly professional computer-relevant technology editor at MiniTool for many years. She has a strong passion for researching all knowledge related to the computer’s disk, partition, and Windows OS. Up till now, she has finished thousands of articles covering a broad range of topics and helped lots of users fix various problems. She focuses on the fields of disk management, OS backup, and PDF editing and provides her readers with insightful and informative content.

Ssh server Windows 10

Starting with Windows 10 1803 (build 17134), Microsoft has enabled OpenSSH within the Command Prompt application as an optional feature.

Enabling the OpenSSH Client on Windows 10

You can enable the OpenSSH Client on your Windows 10 device through the following steps:

  • Open the Start menu and search for “Manage optional features”.
  • The “Optional features” menu lists out features already installed on your device under Installed features. If the OpenSSH Client is listed, the feature has already been enabled and no further action is necessary. If the OpenSSH Client is not listed, choose “Add a feature”.
  • In the following menu, search for “OpenSSH Client”.
  • Click on the checkbox next to OpenSSH Client and then click Install.
  • Windows will then install the OpenSSH client. Once completed, the feature will be listed under Installed features and will be ready to use.

Enabling the OpenSSH Client on Windows 11

You can enable the OpenSSH Client on your Windows 11 device through the following steps:

  • Open the Settings application and search for “Optional features”.
  • The Manage optional features menu lists out features already installed on your device under Installed features. If the OpenSSH Client is listed, the feature has already been enabled and no further action is necessary. If the OpenSSH Client is not listed, choose “View features”.
  • In the following menu, search for “OpenSSH Client”.
  • Click on the checkbox next to OpenSSH Client and then click “Next”. In the following window, click “Install” to confirm the installation.
  • Windows will then install the OpenSSH client. Once completed, the feature will be listed under Installed features and will be ready to use.

Using the OpenSSH Client to Access UHUNIX

You can use the OpenSSH Client in Windows to access your UHUNIX account through the following steps:

    If this is the first time you are connecting to your UHUNIX account through SSH on your Windows device, you will receive a message like the following:

Using the OpenSSH Client for SFTP

The OpenSSH Client also allows the use of SFTP within the Command Prompt application. To use the OpenSSH Client as a SFTP client, please use the following instructions:

  • Open the Command Prompt application.
  • In the Command Prompt application, type the following command:

    If this is the first time you are connecting to your UHUNIX account through SSH on your Windows device, you will receive a message like the following:

The OpenSSH client does not offer a graphical user interface (GUI) for SFTP. For instructions on how to install a SFTP client with a GUI, please see Askus article 1740.

Disabling the OpenSSH Client

You can disable the OpenSSH Client on your Windows device through the following steps:

  • Open the Start menu and search for “Manage optional features”.
  • In the list of Installed features, click on OpenSSH Client and select Uninstall.
  • Once the uninstall is complete, the OpenSSH Client will be disabled.

Not the answer you were looking for? Try different keyword combinations and if you still can’t find your answer, please contact us.

| Denial of responsibility | Contacts |RSS