Set up Windows 10 SSH Server



Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # if openssh server not present
# Store in C:\Windows\system32\OpenSSH
# Start the sshd service
Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# Confirm the firewall rule is configured. It should be created automatically by setup.
Get-NetFirewallRule -Name *ssh*
# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled
# If the firewall does not exist, create one
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
    

Check ip and username via,


ipconfig
whoami #desktop-n9noq3t\leo so leo is username
ssh leo@192.168.1.102
    

References


  1. How to Enable OpenSSH Server in Windows 10
  2. Install OpenSSH