ubuntu 16.04 ssh 登录添加 Google Aut
作者:
春秋不做梦 | 来源:发表于
2021-07-05 09:50 被阅读0次安装 Google Authenticator
$ sudo apt install libpam-google-authenticator
安装完成之后修改文件 /etc/pam.d/sshd
,在此文件末尾添加
$ sudo vi /etc/pam.d/sshd
auth required pam_google_authenticator.so
####没有开启两部验证的账号还可以登录,添加nullok
auth required pam_google_authenticator.so nullok
修改sshd配置文件
#no修改为yes
ChallengeResponseAuthentication yes
重启ssh服务
sudo systemctl restart sshd
来生成一个二维码和密匙,全部选择yes
$ google-authenticator
ssh ubuntu@<ip>
Verification code:
Password:
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)
本文标题:ubuntu 16.04 ssh 登录添加 Google Aut
本文链接:https://www.haomeiwen.com/subject/vbhkultx.html
网友评论