claude-code - 💡(How to fix) Fix [BUG] Claude Desktop SSH: keyboard-interactive auth (Duo MFA) prompt never appears, connection times out after 10s [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48259Fetched 2026-04-16 07:04:56
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×5cross-referenced ×3commented ×1

Error Message

22:44:17 [SSH2Connection] Connecting to [email protected]:22 (agent: true, key: true, proxy: false, keyboard: true) 22:44:27 [SSH2Connection] Connection error: Timed out while waiting for handshake

Root Cause

Root cause: The ssh2 Node.js library connects and initiates keyboard-interactive auth. The server sends the Duo MFA challenge. But Claude Desktop's callback handler for displaying the interactive prompt is broken — the prompt never renders, so auth stalls until the 10s handshake timeout. This is a regression — the same flow worked at 14:04 and in previous versions.

Code Example

14:04:08 [SSH2Connection] Connecting to qiweipan@narval.alliancecan.ca:22 (agent: true, key: true, proxy: false, keyboard: true)
14:04:15 [SSH2Connection] Connected7s (user entered password + Duo)

---

22:44:17 [SSH2Connection] Connecting to qiweipan@narval.alliancecan.ca:22 (agent: true, key: true, proxy: false, keyboard: true)
22:44:27 [SSH2Connection] Connection error: Timed out while waiting for handshake

---

22:20:14 [SSH2Connection] Connecting (agent: true, key: true, proxy: false, keyboard: false)
22:20:15 [SSH2Connection] Connection error: All configured authentication methods failed

---

From ~/Library/Logs/Claude/ssh.log:

# Initial connection WORKED (14:04):
2026-04-14 14:04:08 [info] [SSH2Connection] Connecting to qiweipan@narval.alliancecan.ca:22 (agent: true, key: true, proxy: false, keyboard: true)
2026-04-14 14:04:15 [info] [SSH2Connection] Connected to qiweipan@narval.alliancecan.ca:22

# After network drop, reconnection FAILS (keyboard: true → 10s timeout):
2026-04-14 22:44:17 [info] [SSH2Connection] Connecting to qiweipan@narval.alliancecan.ca:22 (agent: true, key: true, proxy: false, keyboard: true)
2026-04-14 22:44:27 [error] [SSH2Connection] Connection error: Timed out while waiting for handshake

# With keyboard: false → immediate auth failure:
2026-04-14 22:20:14 [info] [SSH2Connection] Connecting to qiweipan@narval.alliancecan.ca:22 (agent: true, key: true, proxy: false, keyboard: false)
2026-04-14 22:20:15 [error] [SSH2Connection] Connection error: All configured authentication methods failed
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

After a Claude Desktop update, SSH remote connection to a host requiring Duo MFA (keyboard-interactive authentication) fails with "Timed out while waiting for handshake" after exactly 10 seconds. The keyboard-interactive auth prompt that previously appeared (allowing password + Duo input) no longer shows up.

Environment:

  • Claude Desktop version: cee98937dc257e6af64e712d71dbe4497eb82452
  • macOS Catalina
  • Remote host: Alliance Canada Narval cluster (narval.alliancecan.ca) — requires Duo MFA for all SSH connections
  • Auth methods offered by server: publickey, keyboard-interactive, hostbased

Key Evidence from ssh.log:

Initial connection (worked, same session):

14:04:08 [SSH2Connection] Connecting to [email protected]:22 (agent: true, key: true, proxy: false, keyboard: true)
14:04:15 [SSH2Connection] Connected — 7s (user entered password + Duo)

After network disconnection — all reconnection attempts fail:

22:44:17 [SSH2Connection] Connecting to [email protected]:22 (agent: true, key: true, proxy: false, keyboard: true)
22:44:27 [SSH2Connection] Connection error: Timed out while waiting for handshake

With keyboard: false — auth fails immediately (confirming server requires keyboard-interactive):

22:20:14 [SSH2Connection] Connecting (agent: true, key: true, proxy: false, keyboard: false)
22:20:15 [SSH2Connection] Connection error: All configured authentication methods failed

What I've verified:

  • Terminal ssh works perfectly (connects instantly)
  • Server port 22 is reachable, SSH handshake completes normally from other clients
  • SSH key is not passphrase-protected
  • Host keys are in ~/.ssh/known_hosts
  • Not an IP ban / rate limiting issue
  • Tried: fresh SSH host config, restarting Claude, modifying known_hosts, adjusting StrictHostKeyChecking

Root cause: The ssh2 Node.js library connects and initiates keyboard-interactive auth. The server sends the Duo MFA challenge. But Claude Desktop's callback handler for displaying the interactive prompt is broken — the prompt never renders, so auth stalls until the 10s handshake timeout. This is a regression — the same flow worked at 14:04 and in previous versions.

Related: #32734 #35073 #39752

What Should Happen?

Claude Desktop should display a keyboard-interactive authentication prompt (as it did in previous versions) allowing the user to enter their password and complete Duo MFA verification. After successful authentication, the SSH remote session should be established normally.

Error Messages/Logs

From ~/Library/Logs/Claude/ssh.log:

# Initial connection WORKED (14:04):
2026-04-14 14:04:08 [info] [SSH2Connection] Connecting to [email protected]:22 (agent: true, key: true, proxy: false, keyboard: true)
2026-04-14 14:04:15 [info] [SSH2Connection] Connected to [email protected]:22

# After network drop, reconnection FAILS (keyboard: true → 10s timeout):
2026-04-14 22:44:17 [info] [SSH2Connection] Connecting to [email protected]:22 (agent: true, key: true, proxy: false, keyboard: true)
2026-04-14 22:44:27 [error] [SSH2Connection] Connection error: Timed out while waiting for handshake

# With keyboard: false → immediate auth failure:
2026-04-14 22:20:14 [info] [SSH2Connection] Connecting to [email protected]:22 (agent: true, key: true, proxy: false, keyboard: false)
2026-04-14 22:20:15 [error] [SSH2Connection] Connection error: All configured authentication methods failed

Steps to Reproduce

  1. Configure an SSH host in Claude Desktop pointing to a server requiring keyboard-interactive auth (Duo MFA) — e.g. Alliance Canada Narval cluster (narval.alliancecan.ca)
  2. Connect for the first time — keyboard-interactive prompt appears, user completes password + Duo MFA, connection succeeds
  3. Network disconnection occurs, SSH session drops
  4. Click "Try again" to reconnect
  5. No authentication prompt appears — connection hangs for exactly 10 seconds then fails with "Timed out while waiting for handshake"
  6. Deleting the SSH host and re-adding it does NOT fix the issue — the prompt still never appears
  7. Restarting Claude Desktop does NOT fix the issue

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

cee98937dc257e6af64e712d71dbe4497eb82452 (Claude Desktop, Cowork mode)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • The SSH host is Alliance Canada Narval cluster which requires Duo MFA for ALL connections (no way to bypass with keys alone)
  • Terminal SSH works perfectly — both fresh connections (with password+Duo) and ControlMaster-multiplexed ones
  • The ssh2 Node.js library successfully completes TCP connect and key exchange, but stalls during keyboard-interactive auth because the prompt callback never fires
  • OS and Platform dropdowns are already set correctly (macOS, Anthropic API, Terminal.app)
  • Related issues: #32734 #35073 #39752

extent analysis

TL;DR

The most likely fix is to update the ssh2 Node.js library or the Claude Desktop application to properly handle keyboard-interactive authentication prompts after a network disconnection.

Guidance

  • Verify that the issue is indeed related to the ssh2 library's handling of keyboard-interactive authentication by checking the library's documentation and version.
  • Check the Claude Desktop application's code to see if there are any changes or updates that can be made to properly handle the authentication prompt callback.
  • Consider downgrading the ssh2 library or Claude Desktop application to a previous version where the issue was not present, if possible.
  • If the issue is confirmed to be a regression, check the related issues (#32734 #35073 #39752) for any potential fixes or workarounds.

Example

No code snippet is provided as the issue is related to a specific library and application, and the fix would depend on the implementation details of the ssh2 library and Claude Desktop application.

Notes

The issue seems to be a regression, and the root cause is likely related to the ssh2 library's handling of keyboard-interactive authentication prompts after a network disconnection. The fix would depend on the specific implementation details of the library and the Claude Desktop application.

Recommendation

Apply a workaround by downgrading the ssh2 library or Claude Desktop application to a previous version where the issue was not present, if possible, until a proper fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING