我想用密码 + google_otp 登录到我的 vpn 服务。freeradius 作为身份验证服务器,ldap 作为 backend_database。
我已经完成了以下工作:</p>
- 在 /etc/raddb/sites-enabled/default 中启用 pam 身份验证模块
- 在 /etc/raddb/users 添加一行“DEFAULT Auth-Type := PAM”
- 启用 ldap 模块并将 ldap 站点添加到 freeradis,我确认 raidus 使用 ldap 数据库工作正常。
- 覆盖 /etc/pam.d/radiusd 的内容
验证必需 pam_google_authenticator.so secret=/tmp/.google_authenticator user=root forward_pass 需要验证 pam_unix.so use_first_pass
运行测试cmd:(testpa是我的密码,271082是otp)
radtest perlingzhao testpa271082 localhost 1812 testing123
半径日志:
(0) [pap] = noop
(0) } # authorize = updated
(0) Found Auth-Type = pam
(0) # Executing group from file /etc/raddb/sites-enabled/default
(0) authenticate {
(0) pam: Using pamauth string "radiusd" for pam.conf lookup
(0) pam: ERROR: pam_authenticate failed: User not known to the underlying authentication module
(0) [pam] = reject
(0) } # authenticate = reject
(0) Failed to authenticate the user
(0) Using Post-Auth-Type Reject
登录 /var/log/secure:
radiusd(pam_google_authenticator)[11728]: Accepted google_authenticator for perlingzhao
pam_unix(radiusd:auth): check pass; user unknown
pam_unix(radiusd:auth): authentication failure; logname=root uid=0 euid=0 tty= ruser= rhost=
我知道这是因为没有本地用户,用户信息在 ldap 中。
任何人都可以帮助我,告诉我如何配置可以解决这个问题,谢谢。