关键字:ssh、google、authenticator
时间:2018年5月
前言
关于google authenticator的用途及原理这里未做任何阐述,请自行了解。
安装配置要点
1、安装libpam-google-authenticator库,通过linux发行版包管理工具安装比较方便。
2、生成秘钥并添加到google authenticator应用程序中
3、ssh配置需要修改两处
a)pam验证模块需要增加相应配置
b)ssh配置文件需要开启验证功能
安装配置步骤
root@debian:~# apt-get install libpam-google-authenticator root@debian:~# google-authenticator Do you want authentication tokens to be time-based (y/n) y +-------+ | | | 二维码 | // 使用google authentitactor添加 | | +-------+ Do you want me to update your "/root/.google_authenticator" file (y/n) y ... your chances to notice or even prevent man-in-the-middle attacks (y/n) y ... Do you want to do so? (y/n) y ... Do you want to enable rate-limiting (y/n) y root@debian:~# vim /etc/pam.d/sshd ... auth required pam_google_authenticator.so :wq root@debian:~# vim /etc/ssh/sshd_config ... #ChallengeResponseAuthentication no ChallengeResponseAuthentication yes ... :wq root@debian:~# service ssh restart