[BUG] SSH remote connector fails with "Host denied (verification failed)" after server host key rotation — no re-trust prompt shown
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?
Summary:
The SSH connector in Claude Desktop (used to run Claude Code on a remote machine) permanently refuses to connect to a host whose SSH host key has changed (e.g. after the remote server was rebuilt/reinstalled), instead of prompting the user to accept/re-trust the new key like a normal SSH client would.
Environment:
Claude Desktop on macOS (Apple Silicon/Intel — MacBook Air)
Feature: "Modifica connessione SSH" / remote SSH connector for running Claude Code on a remote machine
Multiple SSH connections configured to sibling EC2 instances (a6, a, a8, a9, a10), all reachable via normal ssh from Terminal with the same identity (1Password SSH agent)
What Should Happen?
Expected behavior:
When a host key mismatch is detected, the user should be shown a clear confirmation dialog (fingerprint of old vs. new key) allowing them to explicitly trust the new key, similar to standard OpenSSH behavior — instead of a silent hard denial.
There should be a supported, low-risk way (e.g. a "forget host key" button next to each SSH connection in Settings) to clear a single stale host-key entry without needing to touch the underlying VM image or lose unrelated session data.
Impact: Some of our SSH connections are permanently unusable in Claude Desktop until this is addressed, even though they work fine via a standard terminal SSH client.
Error Messages/Logs
Steps to Reproduce
Steps to reproduce:
Configure an SSH connection to a remote host in Claude Desktop's SSH connector.
At some point the remote host is rebuilt/reinstalled, generating a new SSH host key (while the hostname/DNS stays the same).
Try to connect to that host again from Claude Desktop.
Connection fails immediately with:
[warn] [SSH2Connection] Rejecting host key for <host>:22 — presented key does not match known_hosts (host key changed; possible MITM)
[error] [SSH2Connection] Connection error: Host denied (verification failed)
The UI only shows a generic "host denied" error with no way to review/accept the new key. This happens even though:
A normal ssh connection from Terminal to the same host, with the same key/agent, succeeds without issue (after the usual one-time host-key confirmation).
Removing the host from the trustedHosts array in ~/Library/Application Support/Claude/ssh_configs.json has no effect — the error persists identically.
Root cause found:
The actual cached host key appears to live inside a VM disk image used by Claude Desktop's local sandbox/VM feature, at:
~/Library/Application Support/Claude/vm_bundles/claudevm.bundle/sessiondata.img
This file contains the stale host key fingerprint (confirmed via grep matching a fragment of the old host key). This is not exposed anywhere in the UI, and there is no supported way to clear/update a single stale entry without resetting the entire VM bundle (which would also wipe unrelated local session data).
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude 1.17377.1 (2b3ab4) 2026-06-30T20:11:42.000Z
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_