谷歌身份驗證器,即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"方式登陸
而後再次鏈接的時候,就會提示先輸入二次身份驗證碼,再輸入用戶密碼。