sudo apt update
sudo nano /etc/ssh/sshd_config
Change Where It Says The Following ChallengeResponseAuthentication
From no To yes
Save And Exit
Restart The SSH Server:
sudo systemctl restart ssh
Install The Google Software:
sudo apt install libpam-google-authenticator
Run The Following Command To Scan Barcode:
google-authenticator
You May Want To Write Down The Emergency Numbers For A Backup:
Now We Need To Edit The Following File And Add A Few Lines:
sudo nano /etc/pam.d/sshd
# 2FA
auth required pam_google_authenticator.so
Save And Exit
Now We Can Do A sudo reboot On The Pi And Try The 2FA Login