Skip to content

Password fallback not working in normal execution (when SSH agent auth fails) #84

@inureyes

Description

@inureyes

Root Cause Analysis

In src/commands/interactive/connection.rs:74-76, the password fallback condition:

Err(SshError::KeyAuthFailed)
    if allow_password_fallback && atty::is(atty::Stream::Stdin) =>

This condition only matches KeyAuthFailed error, but different errors are returned when SSH agent authentication fails:

  • AgentAuthenticationFailed - SSH agent authentication failed (most common)
  • AgentNoIdentities - No identities in SSH agent
  • AgentConnectionFailed - SSH agent connection failed
  • AgentRequestIdentitiesFailed - Identity request failed

Requested Fix

  1. In establish_connection function in src/commands/interactive/connection.rs:

    • Include SSH agent-related authentication failure errors in the password fallback condition
    • Extend pattern matching to SshError::KeyAuthFailed | SshError::AgentAuthenticationFailed | SshError::AgentNoIdentities, etc.
  2. Verify error type definitions (src/ssh/tokio_client/error.rs):

    • Confirmed that required error types are already defined
  3. Post-fix testing:

    • Run cargo check
    • Run cargo clippy
    • Run cargo test

Reference Files

  • src/commands/interactive/connection.rs - Target for modification
  • src/ssh/tokio_client/error.rs - Error type definitions
  • src/ssh/tokio_client/authentication.rs - Authentication logic (for reference)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions