Remote SSH Access to a Windows Machine from Debian: Full Setup, Fixes, and Lessons Learned
I wanted to remotely access my Windows laptop (with GPU) from my Debian machine using SSH. However, Windows 11 (especially Insider/Canary builds) often breaks or removes the built-in OpenSSH Server capability. This article documents every step needed to get SSH working correctly: installation, service creation, firewall rules, password setup, configuration fixes, and overcoming common errors.
This guide uses JohnDoe as the Windows username. Replace it with your own.
System Setup
- Client machine: Debian Linux
- Remote machine: Windows 11 (Canary build)
- Goal: SSH from Debian into Windows using password authentication
1. Problem: OpenSSH Server Optional Feature Fails to Install
On Windows Canary builds, installing OpenSSH Server via:
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
often hangs indefinitely.
To avoid this issue, install OpenSSH manually.
2. Manual Installation of OpenSSH (MSI Method)
Download the official MSI:
OpenSSH-Win64-v10.0.0.0.msi
Source: https://github.com/PowerShell/Win32-OpenSSH/releases/latest
Install it normally. After installation, binaries are located in:
C:\Program Files\OpenSSH\
3. Create the SSH Service Manually
On some Windows builds, the MSI installs binaries but does not register the sshd service.
Create it using sc.exe.
Open PowerShell as Administrator:
sc.exe create sshd binPath= "C:\Program Files\OpenSSH\sshd.exe" start= auto
sc.exe description sshd "OpenSSH SSH Server"
Start-Service sshd
Verify service state:
Get-Service sshd
Verify startup:
Get-CimInstance -ClassName Win32_Service -Filter "Name='sshd'" | Select-Object Name, StartMode, State
Expected:
Name StartMode State
sshd Auto Running
4. Allow SSH Through Windows Firewall
New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Server" -Enabled True -Direction Inbound -Protocol TCP -LocalPort 22 -Action Allow
5. Determine Windows Local IP Address
ipconfig
Look for the IPv4 address of the active adapter, for example:
IPv4 Address: 192.168.68.103
Use this IP when connecting from Debian.
6. Set a Password for the Windows User (Required for SSH)
If your account only uses PIN/face/fingerprint, SSH cannot authenticate.
A real password must be set.
net user JohnDoe *
Enter a password when prompted.
This is the password that SSH will use.
7. SSH Configuration Fixes (Optional but Recommended)
Open:
notepad "C:\Program Files\OpenSSH\sshd_config"
Ensure the following lines exist and are not commented:
PasswordAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
If this block exists, comment it out to avoid override issues:
#Match Group administrators
# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
Restart the service:
Restart-Service sshd
8. (Optional) Add SSH Key Authentication
On Debian:
ssh-keygen -t ed25519 -C "debian-client"
cat ~/.ssh/id_ed25519.pub
On Windows:
mkdir $env:USERPROFILE\.ssh -Force
notepad $env:USERPROFILE\.ssh\authorized_keys
Paste the key and save.
Set valid ACL permissions:
cmd /c 'icacls "C:\Users\JohnDoe\.ssh" /inheritance:r'
cmd /c 'icacls "C:\Users\JohnDoe\.ssh" /grant JohnDoe:(F)'
cmd /c 'icacls "C:\Users\JohnDoe\.ssh\authorized_keys" /inheritance:r'
cmd /c 'icacls "C:\Users\JohnDoe\.ssh\authorized_keys" /grant JohnDoe:(R)'
9. SSH From Debian
ssh JohnDoe@192.168.68.103
When prompted for host authenticity, enter:
yes
Then provide the password created via net user.
10. Notes and Hurdles Encountered
OpenSSH capability installation hanging
The built-in feature installer may freeze on Canary builds.
The MSI avoids this entirely.
Service missing after reboot
If the service shows “marked for deletion”, reboot and recreate using sc.exe.
Authentication failures
If SSH keeps asking for a password, ensure:
- The Windows user has a real password
-
PasswordAuthentication yesis set - sshd is restarted
Public key not accepted
Verify:
- The file is named
authorized_keys(no extension) - ACL permissions are correct
-
AuthorizedKeysFilepath matches
Also, All my accounts on the browser were logged out.
Conclusion
SSH access from Linux to Windows is entirely possible, even on unstable Windows builds, but may require manual installation steps and fixes. Following the process above provides a stable, repeatable configuration with accurate commands and known troubleshooting solutions.
This article may be updated later to include additional remote access enhancements such as Parsec, TeamViewer, RustDesk, and Wake-on-LAN.
Top comments (0)