mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-22 16:10:50 +00:00
Two compounding issues caused SFTP connections to fail when keyboard-interactive (MFA) authentication was required: 1. ssh2-sftp-client's connect() installs error listeners that reject the entire connection on ANY error, including non-fatal agent auth failures. This prevents ssh2 from falling through to keyboard-interactive. Fix: bypass ssh2-sftp-client's connect() and use direct ssh2.Client with err.level === 'agent' filtering. 2. getSshAgentSocket() on Windows unconditionally returned the agent pipe path without checking if the SSH Agent service is running. Fix: added async getAvailableAgentSocket() that runs 'sc query ssh-agent' before returning the pipe path.