Report this

What is the reason for this report?

False positive "keyboard-interactive" / "Further authentication required" from Multi-Factor

Posted on April 9, 2022

After following the “How To Set Up Multi-Factor Authentication for SSH” guide (https://www.digitalocean.com/community/tutorials/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-20-04), all users get the Further authentication required / keyboard-interactive message from the server when logging in - also users that doesn’t have multi-factor active.

This messes with the PHP library I use to make SSH connections, phpseclib, as it expects to be prompted for multi-factor, but it actually doesn’t.

Connecting through something like PuTTY, it works just fine; it does note that “Further authentication is required”, but it just ignores it and successfully logs in - I’m just not that lucky with the mentioned library.

I did follow Step 7 in the mentioned guide, but it still seems like it prompts somehow…

Does anyone know how to make the server not send the keyboard-interactive message to the client, when it’s indeed not needed?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

If you’re encountering issues with keyboard-interactive authentication while using the phpseclib library, it might be helpful to try configuring the SSH server to avoid prompting for multi-factor authentication if it’s not required for certain users.

You can create a specific Match User block within the /etc/ssh/sshd_config file to specify conditions for the users who will NOT use MFA:

  1. Match User user1,user2
  2. AuthenticationMethods publickey

Make sure to replace user1 and user2 with the actual usernames of the non-MFA users. This configuration will require only public key authentication for the specified users, skipping the keyboard-interactive message you mentioned.

After editing the configuration, don’t forget to restart the SSH service:

  1. sudo systemctl restart ssh

For more details on SSH server configuration, you can refer to this DigitalOcean tutorial.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.