SSH Google 身份验证器忽略/白名单 ips

Phy*_*iOS 3 google-authenticator

我安装了 google 身份验证器(两步验证),“libpam-google-authenticator”包,尽管它要求为每个到 SSH 的连接提供代码。我想将 localhost 和我自己的 ip 从谷歌身份验证器列入白名单,所以我和 localhost 跳过两步验证

或者有没有办法跳过某些 ip 的 SSH 挑战?

Phy*_*iOS 5

在“/etc/pam.d/sshd”中

auth [success=1 default=ignore] pam_access.so accessfile=/etc/security/access-local.conf
auth required pam_google_authenticator.so
Run Code Online (Sandbox Code Playgroud)

然后在“/etc/security/access-local.conf”

#localhost doesn't need two step verification
+ : ALL : 192.168.1.0/24
+ : ALL : LOCAL
+ : ALL : YOURIPHERE
#All other hosts need two step verification
- : ALL : ALL
Run Code Online (Sandbox Code Playgroud)

别忘了重启ssh