Skip to content

Instantly share code, notes, and snippets.

@michelep
Created December 27, 2021 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michelep/6c7ec07796309e3bb8f6d6a08d60ddeb to your computer and use it in GitHub Desktop.
Save michelep/6c7ec07796309e3bb8f6d6a08d60ddeb to your computer and use it in GitHub Desktop.
TOTP authentication for SSH on Debian/Ubuntu servers
sudo apt update && sudo apt install --assume-yes libpam-google-authenticator
sudo vi /etc/ssh/sshd_config:
ChallengeResponseAuthentication yes
sudo systemctl restart ssh
sudo vi /etc/pam.d/sshd:
auth required pam_unix.so no_warn try_first_pass
auth required pam_google_authenticator.so
google-authenticator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment