Running OpenSSH in Windows PowerShell

San Fransico. Phot Cred: Max Raju


Install OpenSSH

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
Name  : OpenSSH.Client~~~~
State : Installed
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~


cd C:\Users\<your-user-name>
mkdir .ssh
cd .ssh
New-Item config
notepad config
Host MyServer
User user
Port 22
IdentityFile c:\Users\maxar\.ssh\private-key-file


ssh MyServer

Passing Commands to SSH

ssh MyServer systemctl restart my-service.service



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store