Running OpenSSH in Windows PowerShell

San Fransico. Phot Cred: Max Raju

Pre-requisites

Install OpenSSH

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

Configuration

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

Connecting

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