Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Step 1: Run this command belowing
- # yum install -y google-authenticator
- If it not found, please run this yum install -y epel-release then run again above command.
- Step 2: Press command line google-authenticator and confirm yes or y.
- Step 3: Edit file /etc/pam.d/sshd
- Add: auth required pam_google_authenticator.so
- Comment: #auth substack password-auth # To prevent ssh by password, obligate ssh by key.
- Step 4: Edit file /etc/ssh/sshd_config
- Change ChallengeResponseAuthentication no to ChallengeResponseAuthentication yes
- AuthenticationMethods publickey,keyboard-interactive
- Step 5: Restart SSH and join download app Google Authenticator
- Android: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=vi
- IOS: https://apps.apple.com/us/app/google-authenticator/id388497605
- Step 6: Finally and SSH with code Google Authenticator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement