---
title: "SSH and PowerShell: Set Up Windows SSH Client"
description: "Learn to set up Windows SSH client and use SSH with PowerShell Remoting. Enhance your IT skills and streamline your remote management."
canonical: "https://adamtheautomator.com/powershell-ssh/"
---

# SSH and PowerShell: Set Up Windows SSH Client

> Learn to set up Windows SSH client and use SSH with PowerShell Remoting. Enhance your IT skills and streamline your remote management.

Source: https://adamtheautomator.com/powershell-ssh/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![SSH and PowerShell: Set Up Windows SSH Client](https://adamtheautomator.com/wp-content/uploads/2020/03/olio-creative-gzVRFfafToM-unsplash.jpg)

# SSH and PowerShell: Set Up Windows SSH Client

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)10 March 20204 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Before You Start](#before-you-start)
*   [SSH Client (Windows 10) Setup](#ssh-client-windows-10-setup)
*   [Add the OpenSSH Folder to the PATH environment variable](#add-the-openssh-folder-to-the-path-environment-variable)
*   [Specify the SSH Subsystem](#specify-the-ssh-subsystem)
*   [Connecting via PowerShell and SSH](#connecting-via-powershell-remoting-and-ssh)
*   [Summary](#summary)
*   [#PS7Now Contributors](#-ps7now-contributors)

Once upon a time, you were limited in the kind of computers you could connect to with Windows PowerShell using [PowerShell Remoting](https://learn.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.2). Since PowerShell Remoting only supported the [WsMan provider](https://learn.microsoft.com/en-us/powershell/module/microsoft.wsman.management/about/about_wsman_provider?view=powershell-7.2), your chances of connecting to computers running Linux, for example, were nil. Back in 2015 though, Microsoft [introduced support for SSH](https://www.thomasmaurer.ch/2015/06/windows-and-powershell-support-for-ssh/) in Windows bringing forth tons of potential and finally allowing you to use SSH and PowerShell together.

In this article, we’re going to dive in and see how to set up Windows’ SSH client and how you can leverage SSH and PowerShell Remoting.

Related:[A Windows Guy in a Linux World: Setting up SSH Command in Linux](https://adamtheautomator.com/ssh-command-in-linux/)

> _This SSH and PowerShell post is part of the #PS7Now blog series. Be sure to check out all of the other contributors in this series at the bottom of this post._

## Before You Start

This article will be a walkthrough tutorial. If you intend to follow along, be sure you meet the following prerequisites:

*   Windows 10 – All examples will use Windows 10 Build 1903. The example will be in the same domain as the remote Windows Server.
*   PowerShell v6+ installed on Windows 10 – All examples will use PowerShell 7 RC2.
*   A remote SSH server – All examples will use a [Windows Server SSH machine](https://techcommunity.microsoft.com/t5/itops-talk-blog/installing-and-configuring-openssh-on-windows-server-2019/ba-p/309540). If you’re connecting to a Linux machine, you can skip the server setup steps.
*   TCP port 22 available on the remote server

Related: [How to Set Up OpenSSH on a Windows Server \[Complete Guide\]](https://adamtheautomator.com/openssh-windows/)

## SSH Client (Windows 10) Setup

Before you open up a PowerShell console, you’ll first need to perform a few one-time tasks to get SSH and PowerShell working together to make sure Windows 10 can connect to a remote SSH server.

### Add the OpenSSH Folder to the PATH environment variable

OpenSSH comes pre-installed on Windows 10 but sometimes needs a little help to work with [PowerShell Remoting](https://adamtheautomator.com/psremoting/ "PowerShell Remoting"). If you’ve already tried to use `Enter-PSSession`, for example, to connect to a remote SSH system and came across the error below, you need to ensure the path to the OpenSSH executable (_ssh.exe_) in the PATH [environment variable](https://adamtheautomator.com/powershell-environment-variables/ "environment variable").

```powershell
Enter-PSSession : An error has occurred which PowerShell cannot handle. A remote session might have ended.
```

To add the OpenSSH folder path to the PATH environment variable, click on the **Start** button and search for _advanced system settings_ then click on **View Advanced System Settings** as shown below.

![Adding OpenSSH folder path](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180051.658.png)

Adding OpenSSH folder path

When the **System Properties** window comes up, click on the **Environment Variables** button.

![Environment Variables in System Properties](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180113.736.png)

Environment Variables in System Properties

In the **Environment Variables** window, under **System variables**, select **Path** and click **Edit**.

![System Variables in the Environment Variables](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180127.976.png)

System Variables in the Environment Variables

In the **Edit Environment Variable** window, click **New** then enter the path where the _ssh.exe_ executable resides. For this tutorial, the path is _C:\\Program Files\\OpenSSH_ as shown below. Once input, click **OK** twice to save the new value.

![Editing Environment Variable](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180139.334.png)

Editing Environment Variable

## Specify the SSH Subsystem

You’ll now need to specify the SSH subsystem for PowerShell to call on when connecting via SSH on the remote Windows Server. If you don’t tell PowerShell what subsystem to use, you’ll inevitably get the following error:

`Enter-PSSession : The background process reported an error with the following message: The SSH client session has ended with error message: subsystem request failed on channel 0.`

> _Note that if you’re not connecting to a Windows Server machine, you will not need to perform these steps._

On the remote Windows Server, open the _C:\\ProgramData\\ssh\\ssh\_config_ file. Scroll down to the **override default of no subsystems** section of the _ssh\_config_ file. The section will look like the screenshot below.

![Override Default of no Subsystems](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180150.328.png)

Override Default of no Subsystems

Below the existing _Subsystem_ line, add the PowerShell subsystem using the line below:

```powershell
Subsystem	powershell pwsh.exe -sshs -NoLogo -NoProfile
```

Now save the _ssh\_config_ file and restart the _sshd_ Windows service on the remote Windows server as shown below.

```powershell
Get-Service -Name sshd | Restart-Service
```

Once the service restarts, you should now be able to connect via SSH and PowerShell.

## Connecting via PowerShell and SSH

Now that the configuration is complete, it’s time to test out PowerShell Remoting.

First, attempt to enter an interactive session by using the `Enter-PSSession` cmdlet. Unlike what you may be used to, you will _not_ use the `ComputerName` parameter. Instead, you’ll use the `HostName` parameter to specify the remote computer.

By default, PowerShell Remoting still uses WsMan. To override the default, use the `SSHTransport` parameter to indicate you’d like to connect via SSH and PowerShell.

When you attempt to connect for the first time with a username and password, you’ll need to create an SSH private key. To do so, you’ll be prompted as you can see below. When you’re prompted, type ‘y’ to accept.

![Creating SSH Private Key](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180201.796.png)

Creating SSH Private Key

You’ll then be prompted for the password of the user you’re currently logged in with.

> _Note that in this example the Windows 10 client and Windows Server SSH server are in the same Active Directory domain. By default, PowerShell Remoting will attempt to authenticate with the logged on user. You can also use the `Credential` parameter to specify a different username and password._

After providing the password, you should then be at a familiar PowerShell Remoting prompt.

![Powershell Remoting Prompt](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180221.802.png)

Powershell Remoting Prompt

Now exit out of the session with `exit` and then try out `New-PSSession`. Notice below using the same `HostName` and `SSHTransport` parameters as before, the `Transport` now shows up as `SSH`.

You are also still able to use WsMan as the transport protocol too using the `ComputerName` parameter without using the `SSHTransport` parameter.

> _You aren’t required to use a username and password for SSH. You could instead use a [private key file](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/create-with-openssh/) and use the `KeyFilePath` parameter to provide the location._

![New PSSession Showing up SSH](https://adamtheautomator.com/wp-content/uploads/2020/06/Untitled-2020-06-01T180232.726-1024x284.png)

New PSSession Showing up SSH

Don’t forget to clean up your open sessions with `Get-PSSession | Remove-PSSession`!

## Summary

You should now know how to get both Windows 10 and Windows Server set up to use SSH with PowerShell Remoting. Once configured, the only difference between using WsMan as the transport protocol and SSH is a couple of parameters!

If you’d like to learn more about PowerShell and SSH, be sure to check out [_PowerShell Remoting over SSH_ Microsoft documentation article](https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core?view=powershell-7).

## #PS7Now Contributors

This post was part of a series on PowerShell 7 by the fine contributors you see below. Be sure to check out their posts and see what they’re up to on their blogs!

| Author | Twitter | Blog |
| --- | --- | --- |
| Josh King | @WindosNZ | https://toastit.dev/ |
| Adam Bertram | @adbertram | https://adamtheautomator.com/ |
| Jonathan Medd | @jonathanmedd |  |
| Thomas Lee | @doctordns | https://tfl09.blogspot.com/ |
| Prateek Singh | @singhprateik | https://ridicurious.com |
| Dave Carroll | @thedavecarroll | https://powershell.anovelidea.org/ |
| Dan Franciscus | @dan\_franciscus | https://winsysblog.com/ |
| Jeff Hicks | @jeffhicks | https://jdhitsolutions.com |
| Josh Duffney | @joshduffney | http://duffney.io/ |
| Mike Kanakos | @MikeKanakos | https://www.networkadm.in/ |
| Tommy Maynard | @thetommymaynard | https://tommymaynard.com// |

#PS7Now Contributors

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-ssh%2F&text=SSH%20and%20PowerShell%3A%20Set%20Up%20Windows%20SSH%20Client)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-ssh%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-ssh%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
