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_rsa and /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/config has a matching Host entry with IdentityFile

Steps to Reproduce

  1. Create an SSH connection in Claude Code
  2. Set SSH Host to user@host
  3. Set Identity File to ~/.ssh/id_rsa (a valid, passphrase-free key)
  4. Save and connect
  5. 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)

View original on GitHub ↗

This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗