Question

Setting up SSH with 2FA via Microsoft Authenticator

Our organization uses Microsoft Authenticator and I need to use ssh/SCP via FireZilla.

I’ve found the documentation: How To Set Up Multi-Factor Authentication for SSH on Ubuntu 18.04 which seems promising.

However, Step 1 refers to “Installing Google’s PAM”. My research into whether or not there will be compatibility issues leads me to think “probably not” but before I run this procedure, is anyone able to verify whether or not there are any compatibility issues with Google’s PAM when using MS Authenticator?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

alexdo
Site Moderator
Site Moderator badge
May 30, 2025

Heya,

I believe that Google’s PAM module (libpam-google-authenticator) works with Microsoft Authenticator. There’s no compatibility issue because the module implements TOTP (Time-based One-Time Passwords), which is an open standard. Microsoft Authenticator fully supports TOTP, so it works seamlessly with the codes generated by Google’s PAM.

If you’re using SSH keys and MFA, make sure your /etc/ssh/sshd_config is configured to support both (e.g., AuthenticationMethods publickey,keyboard-interactive)

Regards

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

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.