Advertisement
nguyenhappy92

How to Set Up SSH with Google Authenticator Two-Factor

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