Skip to content

MFA ("keyboard-interactive") not working with version 1.9 #5

@billborsari

Description

@billborsari

I recently set up Google's 2FA system on my local Linux system and found I'm not able to log in using SSHterm with MFA enabled. I've been looking at the source to understand why and think I found the issue.

The auth method is called "keyboard-interactive"

This method happens as part of the initialization process via a callback.

In the sample source, the kbd_callback function creates a prompt to gather the token and sends the token to the server:

static void kbd_callback(const char *name, int name_len,
const char *instruction, int instruction_len,
int num_prompts,
const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts,
LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses,
void **abstract)
{
...
responses[0].text = strdup(password);
responses[0].length = (unsigned int)strlen(password);
...
}

In SSHTerm 1.9, this function is implemented but has two issues:
A) It cannot collect the MFA token
B) The ability to send it to the server.

For A, the existing request_password() can collect the data. For B, I have not figured out how to send that data to the server to complete the login process.

Here is the process to enable Google 2FA on an Ubuntu server for reference: https://ubuntu.com/tutorials/configure-ssh-2fa#1-overview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions