我在Ubuntu18.04.4LTS上使用了2FA和Google身份验证。我将auth required pam_google_authenticator.so nullok添加到/etc/pam.d/common-session中,并正确设置了Google。
当恢复到睡眠模式后的会话时,2FA工作得很好。然而,当我关闭我的计算机并再次启动,2FA没有提示,我只被要求输入我的主密码。你知道为什么吗?
发布于 2020-02-17 11:18:16
问题与主目录的加密有关。如Google身份验证器libpam所述
如果您的系统对主目录进行加密,直到您的用户输入他们的密码后,您必须重新排列PAM配置文件中的条目,以便在请求OTP代码之前解密主目录,或者您必须将秘密文件存储在一个非标准位置。
。如果您是笔记本电脑的唯一用户,下面是使用2FA引导Ubuntu18.04的步骤:
ga:sudo mkdir -m 700 /home/ga
sudo chown yourname:yourgroup /home/gagoogle-authenticator )时,它将在根目录下创建一个配置文件。将此文件复制到未加密的目录:sudo cp ~/.google_authenticator /home/ga/./etc/pam.d/gdm-password的末尾添加这一行:auth required pam_google_authenticator.so secret=/home/ga/.google_authenticator启动你的电脑,你就可以走了。
https://github.com/google/google-authenticator-libpam#encrypted-home-directories
用于桌面的Google身份验证器(lightdm或gdm插件)
https://wiki.archlinux.org/index.php/Google_Authenticator#Desktop_登录
https://askubuntu.com/questions/1208888
复制相似问题