SSH connection ignores Identity File setting, requires ssh-agent
Resolved 💬 9 comments Opened Feb 14, 2026 by solomon23 Closed Apr 17, 2026
Bug Description
Claude Code's SSH connection dialog has an "Identity File (Private Key)" field, but it appears to be ignored. The SSH connection always falls back to asking for a password, even when:
- The correct key path is specified (both
~/.ssh/id_rsaand/Users/<user>/.ssh/id_rsa) - The key has no passphrase
- The key works perfectly from the terminal with
ssh -i ~/.ssh/id_rsa - The
~/.ssh/confighas a matching Host entry withIdentityFile
Steps to Reproduce
- Create an SSH connection in Claude Code
- Set SSH Host to
user@host - Set Identity File to
~/.ssh/id_rsa(a valid, passphrase-free key) - Save and connect
- Claude Code prompts for a password instead of using the key
Workaround
Loading the key into ssh-agent first makes it work:
ssh-add ~/.ssh/id_rsa
Expected Behavior
Claude Code should use the identity file specified in the connection settings (or from ~/.ssh/config) without requiring the key to be loaded into ssh-agent.
Environment
- macOS (Darwin 25.2.0)
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗