env: Amazon Linux 2 (centos 7 custom)
I recently plugged Google Authenticator into sshd, and I want every user to use it.
Current Status
Users can log in without MFA using private keys that I initially provided, but once they set the MFA they must use it.
/etc/pam.d/sshd
#%PAM-1.0
auth required pam_google_authenticator.so nullok secret=${HOME}/.ssh/google_authenticator
auth required pam_permit.so
/etc/ssh/sshd_config
UsePAM yes
PasswordAuthentication no
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive:pam
My Goal
I want to systemically force/guide every user who logs in without MFA to set it. How can I do it systemically?