# sshLog in to a server
Syntax ssh [options] user@host
Tip If ssh is not found, open Settings, Apps, Optional features, and add OpenSSH Client.
# ssh-keygenMake a key pair
Syntax ssh-keygen [options]
# Install the key on a serverThere is no ssh-copy-id on Windows
Syntax PowerShell
# ssh-agentRemember passphrases
Syntax ssh-add [key]
PS> Get-Service ssh-agent | Set-Service -StartupType AutomaticPowerShell Copy
Allow the agent to start (administrator)
PS> Start-Service ssh-agentPowerShell Copy
Start it
> ssh-add %USERPROFILE%\.ssh\id_ed25519CMD Copy
Unlock the key once
# scpCopy files over SSH
Syntax scp source destination
# sftpInteractive transfer
Syntax sftp user@host
Open a session
> put local.txtCMD Copy
Upload (inside sftp)
> get remote.txtCMD Copy
Download (inside sftp)
# ssh tunnelsForward ports
Syntax ssh -L / -R / -D
# config fileShortcuts for servers
Syntax C:\Users\you\.ssh\config
> Host webCMD Copy
A line in the config file
> HostName 203.0.113.10CMD Copy
Add the address on the next line
> User deployCMD Copy
and the user; now just type: ssh web
# Get-WindowsCapabilityInstall OpenSSH
Syntax Add-WindowsCapability
PS> Get-WindowsCapability -Online | Where Name -like 'OpenSSH*'PowerShell Copy
See if it is installed
PS> Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0PowerShell Copy
Install the client (administrator)
PS> Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0PowerShell Copy
Install the server, if you want to log in to this PC
# sshdRun an SSH server on Windows
Syntax Start-Service sshd
Tip Allow port 22 in the firewall, then connect with SSH Command from another computer.