I'd like to configure my (debian) machine to allow ssh logins with two different options for authentication:

  1. ssh public key authentication
  2. password authentication with a (google) 2 factor authentication code

The best I've been able to do resulted in the 2FA code being required even when I was using an ssh key. But that is a deal breaker.

  • How is the Google 2FA implemented? .. If you are using a PAM module you'll need to adjust PAM settings. – RubberStamp Apr 8 at 15:37
  • Yes, I was using Google 2FA via a PAM module. I'll look into PAM settings. – the Goat Apr 8 at 17:17
  • You may also be able to do it this way ... Add this to your server's sshd_config .... AuthenticationMethods publickey keyboard-interactive – RubberStamp Apr 8 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.