Apache 中的 Kerberos 用户身份验证
-
09-06-2019 - |
题
任何人都可以推荐一些非常好的资源来了解如何使用 Kerberos 对 Apache 进行用户身份验证。
有关 Kerberos 的背景阅读也很有用
谢谢
彼得
解决方案
mod_auth_kerb 是一个好的开始: http://modauthkerb.sourceforge.net/. 。如果您需要 Active Directory 支持,请查看此处: http://support.microsoft.com/?id=555092.
其他提示
我发现 mod_auth_spnego 也很好,因为它可以在 Windows 上使用 SSPI,而不需要 MIT Kerberos。 mod_spnego
以下是使用 Active Directory 作为 KDC 的示例:http://oslabs.mikro-net.com/krb_apache.html
我喜欢这篇关于配置 apache 使用 Kerberos 的文章:
http://www.roguelynn.com/words/apache-kerberos-for-django/
(如果你不感兴趣,可以跳过有关django的部分)
编辑:
完整的答案
配置 apache 使用 Kerberos 身份验证非常容易。
我假设您已在计算机上正确配置了 Kerberos。
1) 您的网络服务器必须有密钥表 [1]。
最重要的是,您的网络服务器 有 能够读取密钥表!
2) 你必须有适当的 httpd 模块来进行身份验证 -- mod_auth_kerb
:
LoadModule auth_kerb_module modules/mod_auth_kerb.so
3)然后你必须告诉apache有关Kerberos的信息:
<Location />
AuthName "Kerberos Authentication -- this will be showed to users via BasicAuth"
AuthType Kerberos
KrbMethodNegotiate On
KrbMethodK5Passwd Off
# this is the principal from your keytab (you may lose the FQDN part)
KrbServiceName HTTP/$FQDN
KrbAuthRealms KERBEROS_DOMAIN
Krb5KeyTab /path/to/http.keytab
Require valid-user
Order Deny,Allow
Deny from all
</Location>
然后 apache 将通过以下方式将用户传递到您的应用程序 REMOTE_USER
HTTP 标头。
就是这样。
我还建议您在安装过程中打开 apache 中的调试日志记录。确保您有正确的时间并且 httpd 可以读取 keytab,仅此而已。
[1] http://kb.iu.edu/data/aumh.html
[2] 主要资源: http://www.roguelynn.com/words/apache-kerberos-for-django/