[BUG] SSH connection fails with "All configured authentication methods failed" on macOS → Ubuntu Linux
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?
I tried to debug the SSH connection from Claude Code macOS desktop app using another claude chat session and nothing worked. It prompted me to file a ticket. I asked Claude for a summary of the issue, and this is what it gave me:
Environment
Client: macOS, Claude Desktop app
Server: Ubuntu Linux (remote VPS)
Auth method: RSA keypair, no passphrase
Problem
Claude Code's SSH connection consistently fails with "All configured authentication methods failed". Terminal SSH to the same server with the same credentials works perfectly.
The issue affects servers never previously connected to, ruling out any server-side configuration as the cause.
What was tried (all failed)
Identity File set to ~/.ssh/id_rsa — failed
Identity File set to full absolute path /Users/<user>/.ssh/id_rsa — failed
Identity File set to /Users/<user>/Documents/id_rsa (copy outside ~/.ssh/) — failed, ruling out sandboxing
SSH Host set to alias from ~/.ssh/config — failed
SSH Host set to explicit user@IP — failed
Added KEX algorithm restriction on server (KexAlgorithms -mlkem768x25519-sha256) — failed
Identity File left blank to force SSH agent fallback, with key loaded via ssh-add — failed
Identity File left blank AND all default key files renamed out of ~/.ssh/ to prevent auto-discovery — failed
Installed claude on the remote server manually before connecting — failed
Confirmed working
ssh user@IP from macOS Terminal using the same key — connects immediately
ssh-add -l confirms key is loaded in agent
Notes
The Identity File field appears to be entirely ignored regardless of what is entered. The ssh2 library does not appear to be using the SSH agent either, even when key files are absent from ~/.ssh/. This looks like a regression — connections that worked previously no longer work after a recent update.
What Should Happen?
When I configure the SSH connection in claude code it should connect to my remote server without prompting for a password since my keypair do not have a password set, but no matter what I do it asks me for a password and fails.
Error Messages/Logs
Claude Code just says "All configured authentication methods failed" no matter what
Steps to Reproduce
Set up a new claude code session with the username & IP for an ssh connection, the connection works fine from my terminal. the connection uses a keypair with no password set.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
not entirely sure
Claude Code Version
Claude 1.1.9134 (87a63a) 2026-03-26T22:41:57.000Z
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗