dartssh2 icon indicating copy to clipboard operation
dartssh2 copied to clipboard

2FA support with Google Authenticator (keyboard-interactive doesn't work)

Open bylli79 opened this issue 6 months ago • 1 comments

Hi, First of all, thank you for this great project!

I'm trying to connect to an SSH server that has two-factor authentication (2FA) enabled, using Google Authenticator. The server is configured to require password + OTP (TOTP), which works correctly with OpenSSH or other standard clients using keyboard-interactive authentication.

I’ve tested dartssh2 with the onUserInfoRequest handler, but it seems that the library does not proceed correctly after the password prompt, and I never get the expected prompt to enter the OTP code. So far, I couldn't get the connection to work when 2FA is enabled on the server.

Is there a recommended way to handle this kind of flow with dartssh2? Or could it be a limitation in the current implementation of keyboard-interactive?

Any help or suggestions would be greatly appreciated. Thanks!

bylli79 avatar Jun 29 '25 13:06 bylli79