Basic Environment 1, version uname -vdebian 3.2.54-22, related IP10.131.172.202 II, Install Google-authenticator1, download google-authenticatorwget https://github.com/google/google-authenticator/archive /MASTER.ZIP2, unzip UNZIP MASTER.ZIP3, compile cd /root/google-authenticator-master/libpam./bootstrap.sh ./ CONFIGURE MAKEMAKE INSTALL4, compile-time error prompt and required package 1) ./bootstrap.sh: 2: exec: autoreconf: Not found first find the next package apt-cache search autoconfautoconf - automatic configure Script builder need to install AUTOCONFAPT-GET -Y INSTALL AUTOCONF2) configure: error: unable to find the PAM library or the PAM header Files first find the next package apt-cache search libpam |grep devlibpam0g-dev - development files for pam need to install libpam0g-devapt-get -y install libpam0g-dev3) also need Libtool tool apt-get -y install libtool
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/F9/wKioL1WODnWRj3vhAAIizvGvkbE949.jpg "title=" Bbb.png "alt=" wkiol1wodnwrj3vhaaiizvgvkbe949.jpg "/>
5, according to the picture to see the relevant so file in the following places ll /usr/local/lib/security-rwxr-xr-x 1 root staff 1038 jun 26 22:33 pam_google_authenticator.la-rwxr-xr-x 1 root staff 125089 jun 26 22:33 pam_google_authenticator.so6, get a soft link ln -s /usr/local/lib/ Security/pam* /lib/x86_64-linux-gnu/security, Pam and SSH1, modify tac /etc/pam.d/sshd in/ETC/PAM.D/SSHD configuration |head -1auth required pam_ GOOGLE_AUTHENTICATOR.SO2, back up and modify the content Cp /etc/ssh/sshd_config /etc/ssh/sshd_ Config.bak modifying Challengeresponseauthentication yesdiff /etc/ssh/sshd_config /etc/ssh/sshd_ Config.bak48c48< challengeresponseauthentication yes---> challengeresponseauthentication &NBSP;NO3, Parameter Description challengeresponseauthentication (whether to allow query-answer (challenge-response) authentication) 4, restart the SSH service/etc/init.d/ssh Restart[ ok ] restarting openbsd securE shell server: sshd. Four, use the command to generate the key google-authenticator (when generating the key back to some questions I here all answer Yes)
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/FC/wKiom1WODUCAKxTEAAY7nuxwstc146.jpg "title=" Aaa.png "alt=" Wkiom1woducakxteaay7nuxwstc146.jpg "/>
Five, the Android phone has downloaded the Google Authenticator (can be found in the QQ phone butler to download the authenticator) Enter the key provided in the above image of the hfmmsp37f2yvfg5g (in. Google_authenticator this file also has) After that you can see the 6-digit password six, using SSH connection 1, xshell client SSH link
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/F9/wKioL1WOEICjSetcAAD3eptCrYM750.jpg "title=" Ccc.png "alt=" Wkiol1woeicjsetcaad3eptcrym750.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/F9/wKioL1WOEJbDN548AAFIMW7xsSk371.jpg "title=" Ddd.png "alt=" Wkiol1woejbdn548aafimw7xssk371.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/F9/wKioL1WOEKyhNFT4AACdBwDaSw0314.jpg "title=" Eee.png "alt=" Wkiol1woekyhnft4aacdbwdasw0314.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/FC/wKiom1WODwHRHTUAAACbtgJ0jEo302.jpg "title=" Fff.png "alt=" Wkiom1wodwhrhtuaaacbtgj0jeo302.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/F9/wKioL1WOEN2CvgvxAAGsRQ1q2Ds107.jpg "title=" Ggg.png "alt=" Wkiol1woen2cvgvxaagsrq1q2ds107.jpg "/>
2, Linux client SSH link
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/FC/wKiom1WOD0SxC1LqAAGRJdfORaw043.jpg "title=" Hhh.png "alt=" Wkiom1wod0sxc1lqaagrjdforaw043.jpg "/>
Seven, reference article http://m114.org/google-authenticator-strengthen-ssh-login-security/linux.cn/article-3725-1.html
This article is from the "7928217" blog, please be sure to keep this source http://7938217.blog.51cto.com/7928217/1666233
Install Google-authenticator (SSH dual authentication) on Debian