[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
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

  1. Open Claude Code desktop app on Windows
  2. Add an SSH connection using a host defined in ~/.ssh/config
  3. 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

  1. Open Claude Code desktop app on Windows
  2. Add an SSH connection using a host defined in ~/.ssh/config
  3. 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_

View original on GitHub ↗

6 Comments

github-actions[bot] · 6 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/25659

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

amorriscode contributor · 6 months ago

This will be fixed in the next release.

aftersought · 6 months ago

It seems the issue was indeed fixed in the latest release, but only partially: the windows desktop app still does not use the same ssh that I have set up in the command line, and ignores my PKCS11 key (Yubico). Here is the relevant part of the ssh.log:

2026-02-17 21:30:41 [info] [RemoteServerController] Ensuring server is ready on *** (trigger: send_message)
2026-02-17 21:30:41 [info] [BinaryDeployment] Setting up remote server on ***
2026-02-17 21:30:41 [info] [SSH2Connection] Resolved *** -> ***@***:***
2026-02-17 21:30:41 [info] [SSH2Connection] Connecting to ***@***:*** (agent: false, key: true, proxy: false, keyboard: true)
2026-02-17 21:30:42 [error] [SSH2Connection] Connection error: All configured authentication methods failed
2026-02-17 21:30:43 [info] [SSH2Connection] Retrying with password auth (keyboard-interactive not available)
2026-02-17 21:30:45 [error] [SSH2Connection] Connection error: All configured authentication methods failed
2026-02-17 21:30:45 [error] [RemoteServerController] Connection failed (3814ms, trigger: send_message): All configured authentication methods failed

I also note that the logs show agent: false despite ssh agent running (ssh-add -L shows keys).

petrnohejl · 6 months ago

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 again

I also tried reinstalling it, but it didn't help either.

metegenez · 6 months ago

Strange Cannot parse privateKey: Encrypted private OpenSSH key detected, but no passphrase given Try again error happens, regardless of what I tried

2026-02-19 xxxxxxx [info] [EventLogging] Queuing event: desktop_ssh_connection_failed | metadata: {
  product_surface: 'claude-desktop',
  app_version: '1.1.3541',
  commit_hash: '1e65e4f0a2acc921b2009fc1216fc2b78cd93d18',
  platform: 'win32',
  arch: 'x64',
  error_message: 'Cannot parse privateKey: Encrypted private OpenSSH key detected, but no passphrase given',
  trigger: 'send_message'
}

I tried with/without passphrase. Does this come from a similar error, or should i open up a new issue?

jomapps · 4 months ago

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

[SSH2Connection] Connecting to user@host:22 (agent: none, keys: 1[ssh-ed25519], ...)
[SSH2Connection] ssh2: Client: publickey auth failed
[SSH2Connection] Connection error: All configured authentication methods failed

The Desktop app's internal ssh2 library (not the system SSH):

  1. Cannot load RSA private keys — even after converting from OpenSSH format (-----BEGIN OPENSSH PRIVATE KEY-----) to PEM format (-----BEGIN RSA PRIVATE KEY-----), the key is silently skipped
  2. Ignores IdentityFile and IdentitiesOnly yes in ~/.ssh/config — it always falls back to trying the default ~/.ssh/id_ed25519
  3. Requires forward-slash pathsIdentityFile C:\Users\...\id_rsa is not parsed correctly; use ~/.ssh/keyname instead

Fix

The app will always send ~/.ssh/id_ed25519 regardless of SSH config. So the workaround is:

  1. Make sure you have an ed25519 key at ~/.ssh/id_ed25519 (generate one if needed: ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519)
  2. Add its public key to the server's authorized_keys for the target user:

``
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@yourserver
``

  1. In ~/.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. The IdentityFile line in the config doesn't matter for which key gets sent, but keeping it clean helps readability.

Environment

  • Windows 11 Pro 10.0.26200
  • Claude Desktop (latest)