Install OpenSSH on Windows 10 using PowerShell
If you haven’t heard, the latest versions of Windows 10 now has an OpenSSH client and server. There are several articles that detail how to install OpenSSH from the graphical settings panel in Windows 10 but I had a hard time finding the command to install OpenSSH via powershell.
Install OpenSSH on Windows 10 (via PowerShell)
# Install ssh client from PowerShell
PS C:\> Add-WindowsCapability -Online -Name OpenSSH.Client*
# Install sshd server from PowerShell
PS C:\>Add-WindowsCapability -Online -Name OpenSSH.Server*
Install SSH on Windows 10 (via Graphical Interface)
- Click Start choose Settings
- Choose Apps from Windows Settings
- Click “Manage optional features“
- Click “Add a feature“
- Choose “OpenSSH Client” and click the Install button
Once installed, you should automatically have access to the followings ssh commands from any command prompt or powershell prompt.
- ssh.exe
- scp.exe
- sftp.exe
- ssh-add.exe
- ssh-agent.exe
- ssh-keygen.exe
- ssh-keyscan.exe
The above OpenSSH binaries are located in c:\windows\system32\OpenSSH\
SSH related files such as known_hosts
and any user generated keypairs are located in %USERPROFILE%\.ssh\
ie. c:\users\myuser\.ssh\
Original Photo by Pascal Terjan – Remixed and released under a CC BY-SA license.
8 Replies to “Install OpenSSH on Windows 10 using PowerShell”
Thanks!
I was wondering why after installation, is not globally accesible from cmd ?
We need to import binary path somehow?
have you tried including the executable in your environment variables?
Hi, I don’t have “OpenSSH Client” under Add a feature. Thanks, Keith
You need to be running Windows 10 1809 or higher to see OpenSSH Client.
Thanks for that, JC
I have Windows 10 Home build 19041, but I don’t have “OpenSSH Client” under Add a feature, only “OpenSSH Server”. Thanks.
Sounds good, doesn’t work.
The server part at least
Same with me. OpenSSH Client was already listed under “Installed features” so it didn’t have to be installed.