Ssh Setup



-->

Start by selecting Remote-SSH: Add New SSH Host. From the Command Palette (F1) or clicking on the Add New icon in the SSH Remote Explorer in the Activity Bar. You'll then be asked to enter the SSH connection information. You can either enter a host name: Or the full ssh command you would use to connect to the host from the command line. For instance, on the Ubuntu Server platform, the command to install the SSH daemon is: sudo apt-get install openssh-server -y. For CentOS 7, the command is.

Applies to Windows Server 2019, Windows 10

OpenSSH is a connectivity tool for remote login that uses the SSH protocol. It encrypts all traffic between client and server to eliminate eavesdropping, connection hijacking, and other attacks.

OpenSSH can be used to connect Window 10 clients to Windows Server 2019. OpenSSH Client is available to install on Windows 10 build 1809 and later, while OpenSSH Server is available to install on Windows Server 2019 and later.

Important

If you downloaded OpenSSH from the GitHub repo at PowerShell/openssh-portable, follow the instructions listed there, not the ones in this article.

Install OpenSSH using Windows Settings

Both OpenSSH components can be installed using Windows Settings. OpenSSH Server is installed on Windows Server and OpenSSH Client is installed on Windows 10 devices.

To install the OpenSSH components:

  1. Open Settings, select Apps > Apps & Features, then select Optional Features.

  2. Scan the list to see if the OpenSSH is already installed. If not, at the top of the page, select Add a feature, then:

    • On Windows 10, find OpenSSH Client, then click Install
    • On Windows Server 2019, find OpenSSH Server, then click Install

Once setup completes, return to Apps > Apps & Features and Optional Features and you should see OpenSSH listed.

Note

Installing OpenSSH Server will create and enable a firewall rule named OpenSSH-Server-In-TCP. This allows inbound SSH traffic on port 22. If this rule is not enabled and this port is not open, connections will be refused or reset.

Install OpenSSH using PowerShell

To install OpenSSH using PowerShell, run PowerShell as an Administrator.To make sure that OpenSSH is available, run the following cmdlet:

Setup

This should return the following output:

Then, install the server or client components as needed:

Ssh setup centos

Both of these should return the following output:

Start and configure SSH Server

To start and configure OpenSSH server for initial use, open PowerShell as an administrator, then run the following commands to start the SSHD service:

Connect to SSH Server

Once installed, you can connect to OpenSSH Server from a Windows 10 device with the SSH client installed using PowerShell as follows. Be sure to run PowerShell as an administrator:

Once connected, you get a message similar to the following:

Selecting yes adds that server to the list of known ssh hosts on your Windows client.

You are prompted for the password at this point. As a security precaution, your password will not be displayed as you type.

Once connected, you will see the Windows command shell prompt:

Uninstall OpenSSH using Windows Settings

Ssh Setup No Password

Ssh

To uninstall OpenSSH using Windows Settings:

Ssh Setup Public Key

  1. Open Settings, then go to Apps > Apps & Features.
  2. Go to Optional Features.
  3. In the list, select OpenSSH Client or OpenSSH Server.
  4. Select Uninstall.

Uninstall OpenSSH using PowerShell

Get ssh public key

Setup Ssh Ubuntu

To uninstall the OpenSSH components using PowerShell, use the following commands:

Windows 10 Native Ssh Client

You may need to restart Windows afterwards if the service was in use at the time it was uninstalled.