Skip to content

Latest commit

 

History

History
47 lines (40 loc) · 937 Bytes

2fa.md

File metadata and controls

47 lines (40 loc) · 937 Bytes

Tonton Jo - 2023

Setup 3FA authentication

Install Google Authenticator

sudo apt install libpam-google-authenticator

Enable 2fa for current user

google-authenticator

Enable Google Authenticator module

nano /etc/pam.d/sshd

add:
auth required pam_google_authenticator.so nullok

Enable 2fa for password logins:

nano /etc/ssh/sshd_config

KbdInteractiveAuthentication yes
Restart service

systemctl restart sshd.service

Enable 2fa for passwordless connections using a private key

nano /etc/ssh/sshd_config

AuthenticationMethods publickey,password publickey,keyboard-interactive

  • Restart service
systemctl restart sshd.service

Enable 2fa for console access

nano /etc/pam.d/common-auth

auth required pam_google_authenticator.so nullok