How to install the OpenSSH server on Windows with PowerShell

3 years ago 497

If you've ever had a request to SSH into a Windows machine, Jack Wallen shows you however to marque that imaginable with the assistance of PowerShell.

SSH implicit    servers

Image: Funtap/Shutterstock

Using SSH to distant into a Linux server is incredibly easy. Even installing the SSH server itself is simply a portion of cake. But erstwhile you person a request to SSH into a Windows machine, things get a spot much complicated. It's not terribly challenging, but it's not astir arsenic elemental arsenic it is with Linux.

I'm going to locomotion you done the process of installing the OpenSSH Server connected Windows 10, configuring it to commencement astatine boot, and past amusement you however to log successful from a Linux machine. You whitethorn not ever person a request to bash this, but erstwhile you do, you'll beryllium gladsome you know.

SEE: Hiring Kit: Network Engineer (TechRepublic Premium)

What you'll request

The lone things you'll request are a moving lawsuit of Windows 10, a idiosyncratic with admin privileges and a 2nd instrumentality to log successful from.

With those successful hand, let's get to work.

How to instal OpenSSH connected Windows 10

The archetypal happening to bash is unfastened PowerShell with admin privileges. Click the Start fastener and benignant PowerShell. When you spot the entry, click Run arsenic Administrator and past click Yes. Before we install, we person to find retired which versions of the bundle are available, which tin beryllium done with the command:

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

You should spot the pursuing printed retired successful your PowerShell terminal:

Name : OpenSSH.Client~~~~0.0.1.0 State : NotPresent Name : OpenSSH.Server~~~~0.0.1.0 State : NotPresent

What the supra means is neither the OpenSSH (version 0.0.1.0) lawsuit oregon server is installed. Let's hole that. First, instal the OpenSSH lawsuit with:

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

Next, instal the OpenSSH server with:

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

Now, if you contented the command:

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

Both lawsuit and server should beryllium listed arsenic Installed.

Next, we request to commencement the OpenSSH server with the command:

Start-Service sshd

Now, we'll acceptable the OpenSSH server to commencement astatine boot. For that, issue:

Set-Service -Name sshd -StartupType 'Automatic'

How to SSH into your Windows instrumentality

This is wherever it gets a spot messy. First, you request to find retired what your existent idiosyncratic relationship sanction is. To bash that, click the Start paper and benignant cmd. When the terminal model opens, your username volition beryllium listed successful the signifier of:

C:\Users\USERNAME

Where USERNAME is your existent username.

Next, you'll request the password you utilized to setup your relationship connected Windows 10. This mightiness beryllium your Hotmail password, your Skype password, oregon your OneDrive password.

With some of those pieces of accusation successful hand, spell to your Linux (or different Windows instrumentality with OpenSSH installed) and log successful with:

ssh USERNAME@IP

Where USERNAME is your Windows 10 username and IP is the IP code of your Windows machine. If you don't cognize the IP code of your Windows machine, spell backmost to the cmd terminal model connected Windows and contented the command:

ipconfig/all

The IP code should beryllium listed successful the output.

You should beryllium prompted for your Windows idiosyncratic password. If you effort that password and it fails, you mightiness person to marque definite your Windows instrumentality allows for password login. Many times, the Windows 10 desktops are configured to login via Windows Hello Face, Fingerprint, PIN oregon Security Key. Password is often near retired of that. In bid to alteration password login, bash the following:

  1. Open Settings.
  2. Go to Accounts.
  3. Click Sign-in Options.
  4. Disable the Require Windows Hello Sign-in for Microsoft accounts.
  5. Restart your computer.

When you spell to login, you tin inactive usage your default method of authenticating, but you'll beryllium capable to login with your relationship password via SSH. If you don't disable the Windows Hello requirement, you mightiness person occupation logging successful via SSH. 

Attempt to SSH into the Windows instrumentality again. Hopefully, this clip the process should implicit and you'll find yourself astatine the Windows terminal prompt, acceptable to bash immoderate it is you request to bash connected that machine.

Subscribe to TechRepublic's How To Make Tech Work connected YouTube for each the latest tech proposal for concern pros from Jack Wallen.

Cybersecurity Insider Newsletter

Strengthen your organization's IT information defenses by keeping abreast of the latest cybersecurity news, solutions, and champion practices. Delivered Tuesdays and Thursdays

Sign up today

Also see

Read Entire Article