2025_Sept:
SSH windows pc with Linux for remote control in the same networks
This guide explains how to enable SSH on a Windows PC and connect to it from a Linux machine over the same network.
1. Install OpenSSH Server on Windows
Open PowerShell (Admin).
Check if OpenSSH Server is installed:
Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Server*'
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
2. Start and Enable the SSH Service
Run the following commands in PowerShell (Admin):
Start-Service sshdSet-Service -Name sshd -StartupType Automatic
Verify service is running:
Get-Service sshd
Expected output:
Status Name DisplayName------ ---- -----------Running sshd OpenSSH SSH Server3. Allow SSH in Windows Firewall
New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Server (sshd)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Expected output:
Name : sshdDisplayName : OpenSSH Server (sshd)Enabled : TrueDirection : InboundAction : AllowLocalPort : 224. Get Your Windows IP and Username
On Linux, open a terminal:
ssh "jimmy majumder"@xxx.xxx.xx.xx(or escape the space)
ssh jimmy\ majumder@xxx.xxx.xx.xxEnter your Windows account password → login succeeds.
Example successful login:
Microsoft Windows [Version 10.0.19045.6216](c) Microsoft Corporation. All rights reserved.
jimmy majumder@DESKTOP-VLPKKG7 C:\Users\Jimmy Majumder>You can now run Windows commands (dir, systeminfo, tasklist) remotely.
With this setup, your Windows PC is now a fully functional SSH server accessible from your Linux machine.