https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#!/bin/bash yum -y groupinstall "Development Tools" yum -y install pam-devel ntp bzip2 wget systemctl start ntpd systemctl enable ntpd cd /opt wget https://google-authenticator.googlecode.com/files/libpam-google-authenticator-1.0-source.tar.bz2 bunzip2 libpam-google-authenticator-1.0-source.tar.bz2 tar -xvf libpam-google-authenticator-1.0-source.tar rm -f libpam-google-authenticator-1.0-source.tar cd libpam-google-authenticator-1.0 make make install cd ~ google-authenticator -tdf --rate-limit=3 --rate-time=30 --window-size=17 sed -i '/#%PAM/a auth\ \ \ \ \ \ \ required\ \ \ \ \ pam_google_authenticator.so' /etc/pam.d/sshd sed -i 's/#ChallengeResponseAuthentication\ yes/ChallengeResponseAuthentication\ yes/g' /etc/ssh/sshd_config sed -i 's/ChallengeResponseAuthentication\ no/#ChallengeResponseAuthentication\ no/g' /etc/ssh/sshd_config systemctl reload sshd echo "Please scan QR code into google authenticator and copy safe codes, then test by opening a new ssh connection" |