重点配置(配置及取消):
编辑SSH配置文件
sudo vim /etc/ssh/sshd_config
确保以下行被设置为 yes
ChallengeResponseAuthentication yes
UsePAM yes
若想取消,设置为:no
最后,重启sshd服务。
刨根问底:
1.同步Linux服务器时钟
同步linux时钟,默认动态验证码在30秒内有效,由于客户端和服务器可能会存在时间差,建议先同步时钟,防止和手机时间存在时间差导致无法登录
[root@knode1 ~]# ntpdate pool.ntp.org
5 Dec 23:00:32 ntpdate[6583]: step time server 84.16.73.33 offset -9.050575 sec
2.Linux主机安装Google Authenticator
本文使用Centos7系统实验,在终端执行以下命令,为你的Linux系统安装Google Authenticator插件
yum -y install epel-release # CentOS/RHEL sudo yum install google-authenticator # CentOS/RHEL
3.修改SS