谷歌身份验证器,即Google Authenticator(Google身份验证器)v2.33 谷歌推出的一款动态口令工具,解决你们的google帐户遭到恶意***的问题。linux
一、透过QR图码自动设定
二、支持多个帐户
三、支援多种语言git
一、编辑/etc/selinux/config文件,关闭selinuxSELINUX=disabled
github
二、yum安装相关程序yum -y install gcc make pam-devel libpng-devel libtool wget git
web
三、安装Qrencodeyum install mercurial
bootstrap
四、使用git clone下载google-authenticator-libpam,安装google authenticator PAM插件git clone https://github.com/google/google-authenticator-libpam.git
app
五、进入google-authenticator-libpam目录下,执行脚本./bootstrap.sh && ./configure && make && make install
ssh
六、复制google 身份验证器pam模块到系统下cp /usr/local/lib/security/pam_google_authenticator.so /lib64/security/
ide
七、配置/etc/pam.d/sshd文件,将认证模块添加auth required pam_google_authenticator.so
工具
八、修改SSH服务配置/etc/ssh/sshd_config文件,将注释去掉ChallengeResponseAuthentication yes
ui
九、重启ssh服务service sshd restart
十、切换到须要验证的系统帐户,运行程序google-authenticator
十一、谷歌身份验证器配置
十二、验证
接着在ssh的客户端里设置,以下,设置"Keyboard Interactive"方式登陆
而后再次链接的时候,就会提示先输入二次身份验证码,再输入用户密码。