freeradius + ldap + 谷歌身份验证器

问题描述 投票:0回答:2

我想使用密码 + google_otp 实现登录我的 VPN 服务。 freeradius 作为身份验证服务器,ldap 作为后端数据库。

我已完成以下工作:

  1. 在 /etc/raddb/sites-enabled/default 中启用 pam 身份验证模块
  2. 在 /etc/raddb/users 中添加一行“DEFAULT Auth-Type := PAM”
  3. 启用 ldap 模块并将 ldap 站点添加到 freeradis,我确认 raidus 使用 ldap 数据库工作正常。
  4. 覆盖/etc/pam.d/radiusd的内容
身份验证必需 pam_google_authenticator.so Secret=/tmp/.google_authenticator user=rootforward_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中。

任何人都可以帮助我,告诉我如何配置可以解决这个问题,谢谢。

active-directory ldap radius one-time-password google-auth-library
2个回答
1
投票

我可以建议使用 PHP 脚本进行 OTP 验证而不是 PAM 模块,它不会创建真正的本地用户,而仅验证 TOTP 本身。 PHP 也有 LDAP 功能。

authorize{
    update control { 
        Auth-Type := `/usr/bin/php -f /etc/raddb/yourscript.php '%{User-Name}' '%{User-Password}' '%{Client-IP-Address}'`
    }

有一种商业产品似乎完全满足您的要求。

附注我隶属于#1


0
投票

您可以尝试LinOTP.org。 LinOTP.org 是一种使用一次性密码进行身份验证的解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.