Linux服务器配置Google二次验证登录
1. 准备工作
(1)关闭selinux
[root@google ~]# setenforce 0
(2)安装依赖包
[root@google ~]# yum -y install gcc make pam-devel libpng-devel libtool wget
(3)安装Qrencode,谷歌身份验证器需要调用该程序生成二维码并显示
[root@google ~]# yum install -y qrencode
(4)安装google-authenticator
[root@google ~]# yum install -y google-authenticator
2. Google验证初始化配置
[root@google ~]# google-authenticator


【注】回车后,会有一系列问题,全部输y即可。(二维码要妥善保存,不可丢失)
3. 修改SSH配置增加Google身份验证模块
(1)修改PAM配置文件
[root@google ~]# vim /etc/pam.d/sshd auth required pam_google_authenticator.so #增加这条

(2)启用 ChallengeResponseAuthentication
[root@google ~]# vim /etc/ssh/sshd_config

[root@google ~]# systemctl restart sshd.service
4. 下载Google验证客户端进行测试
客户端下载地址:https://github.com/google/google-authenticator-android/releases





作者:UStarGao
链接:https://www.starcto.com/safetool/123.html
来源: STARCTO
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
UCloud云平台推荐
随便看看
- 2021-05-09CURL方法测试网站响应速度
- 2022-05-15Nginx安全控制-Basic认证与IP黑/白名单
- 2021-02-28Linux账户风险和安全策略
- 2021-09-13开源为知笔记容器化部署
- 2021-06-25MySQL修改wait_timeout变量global生效session不生效



