Connected Tutorial(This question is a follow-up to this tutorial):
How To Set Up Multi-Factor Authentication for SSH on Ubuntu 20.04Hi,
I tried to set up a combination of password and Google’s PAM but it didn’t work.
Without adding: ‘AuthenticationMethods publickey,password publickey,keyboard-interactive’ to /etc/ssh/sshd_config I was allowed to login with just the Google Auth code, but wasn’t asked for the password.
With that line added I got ‘Permission denied’.
So I guess it’s the ‘AuthenticationMethods’ line that is failing (since it specifically includes publickey, which I don’t use). I tried to edit it in various wayd but without success. How should it be written in order to ask for pw and Google Auth code?
Best wishes! David
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!
Hello,
I will recommend you to use an ssh-key and the Google Auth code as it will be a lot more secure instead of using the password for the droplet.
However, if you want to use a password with Google Auth you should be able to set up this via the /etc/ssh/sshd_config file :
- AuthenticationMethods publickey,password publickey,keyboard-interactive
This is listed as Step 3 in the tutorial.
Hope that this helps! Regards, Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.