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云平台推荐
随便看看
- 2022-05-27MongoDB慢查询日志之Profiling配置
- 2021-12-06MySQL PERFORMANCE_SCHEMA监控用法详解
- 2022-11-10UCloud云数据库公网访问解决方案
- 2021-02-13MySQL目录文件与备份方式解读
- 2021-08-22Smokeping+Promethues+Grafana搭建网络质量监控



