I'm trying to enable 2fA authentification on my lighsail server, running ubuntu 20.04. I installed google-authenticator and launched it, configured /etc/pam.d/sshd to add the following line :
auth required pam_google_authenticator.so
auth required pam_permit.so
and then /etc/ssh/sshd_config to set :
ChallengeResponseAuthentication yes
But then nothing happens. If I add the line :
AuthenticationMethods publickey,keyboard-interactive
Then the ssh client asks for a password that I don't have (I have a keypair, but no password). What can I do to enable 2FA ?