天天看點

ssh+Google雙重認證

記錄  SSH + Google-Authenticator 實作過程

環境Centos 6.5 

需要用到epel源,用網易和搜狐的源都沒有找到安裝包,單獨下載下傳需要×××

在伺服器上安裝Google-Authenticator

  1. 首先安裝啟用ntp 伺服器,同步伺服器時間,設定時間同步
  2. 安裝Google-authenticator,安裝完成後,會在/lib64/security新增pam_google_authenticator.so 檔案

    yum install google-authenticator 

  3. 配置/etc/pam.d/sshd

    添加 auth     required   pam_google_authenticator.so

  4. 配置/etc/ssh/sshd_config 

    ChallengeResponseAuthentication yes (改為yes)

ssh+Google雙重認證

5. 重新開機ssh  

6. 執行google-authenticator 生成私鑰 ,在app中添加即可

最後實作過程