[BUG] [Bug] SSH connection fails on Windows: "Failed to spawn /usr/bin/ssh: spawn /usr/bin/ssh ENOENT"
Status Fixed / completed
Maintainer reply ✓ Yes — amorriscode
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened Feb 16, 2026 · closed Aug 25, 2026
💡 Likely answer: A maintainer (amorriscode, contributor)
responded on this thread — see the highlighted reply below.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
The desktop app's "Add SSH connection" feature fails on Windows because it hardcodes the Unix SSH path /usr/bin/ssh instead of using the system PATH to locate the SSH executable.
Error
What Should Happen?
Steps to Reproduce
- Open Claude Code desktop app on Windows
- Add an SSH connection using a host defined in
~/.ssh/config - Attempt to connect
Expected Behavior
The app should locate SSH via the system PATH (e.g., C:\Windows\System32\OpenSSH\ssh.exe) rather than hardcoding /usr/bin/ssh.
Environment
- OS: Windows 11 Pro 10.0.26200
- Claude Code Desktop App Version: v2.1.38
- CLI Version: v2.1.42
- SSH Location:
C:\Windows\System32\OpenSSH\ssh.exe
Workaround
SSH into the remote machine manually and run claude directly from the terminal.
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Open Claude Code desktop app on Windows
- Add an SSH connection using a host defined in
~/.ssh/config - Attempt to connect
Expected Behavior
The app should locate SSH via the system PATH (e.g., C:\Windows\System32\OpenSSH\ssh.exe) rather than hardcoding /usr/bin/ssh.
Environment
- OS: Windows 11 Pro 10.0.26200
- Claude Code Desktop App Version: v2.1.38
- CLI Version: v2.1.42
- SSH Location:
C:\Windows\System32\OpenSSH\ssh.exe
Workaround
SSH into the remote machine manually and run claude directly from the terminal.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
na
Claude Code Version
1.1.3189
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
6 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This will be fixed in the next release.
It seems the issue was indeed fixed in the latest release, but only partially: the windows desktop app still does not use the same
sshthat I have set up in the command line, and ignores my PKCS11 key (Yubico). Here is the relevant part of the ssh.log:I also note that the logs show agent: false despite ssh agent running (
ssh-add -Lshows keys).It still doesn't work in Version 1.1.3541 (1e65e4) on Windows 11 Pro. I get this error:
Binary not found: C:\Program Files\WindowsApps\Claude_1.1.3541.0_x64__pzs8sxrjxfjjc\app\resources\claude-ssh\claude-ssh-linux-amd64 Try againI also tried reinstalling it, but it didn't help either.
Strange
Cannot parse privateKey: Encrypted private OpenSSH key detected, but no passphrase given Try againerror happens, regardless of what I triedI tried with/without passphrase. Does this come from a similar error, or should i open up a new issue?
Workaround that worked on Windows 11
After debugging the SSH log at
%APPDATA%\Claude\logs\ssh.log, I found two root causes and a reliable workaround.What the log revealed
The Desktop app's internal
ssh2library (not the system SSH):-----BEGIN OPENSSH PRIVATE KEY-----) to PEM format (-----BEGIN RSA PRIVATE KEY-----), the key is silently skippedIdentityFileandIdentitiesOnly yesin~/.ssh/config— it always falls back to trying the default~/.ssh/id_ed25519IdentityFile C:\Users\...\id_rsais not parsed correctly; use~/.ssh/keynameinsteadFix
The app will always send
~/.ssh/id_ed25519regardless of SSH config. So the workaround is:~/.ssh/id_ed25519(generate one if needed:ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519)authorized_keysfor the target user:``
``ssh-copy-id -i ~/.ssh/id_ed25519.pub user@yourserver
~/.ssh/config, use forward-slash paths:``
``Host myserver
HostName your.server.ip
User youruser
Port 22
IdentityFile ~/.ssh/id_ed25519
Once the server accepts
~/.ssh/id_ed25519, Claude Desktop connects without issues. TheIdentityFileline in the config doesn't matter for which key gets sent, but keeping it clean helps readability.Environment