mod_auth_kerb主体解析错误

时间:2013-01-18 19:37:40

标签: apache security kerberos

我正在使用mod_auth_kerb& Apache HTTPD根据Kerberos服务器对网站用户进行身份验证。我在Apache错误日志中收到一条奇怪的错误消息。 (请注意,出于安全原因,我已在本帖中更改了主体,但格式保持不变)。打开Apache的调试级别输出允许我获得更多信息性日志:

[debug] src/mod_auth_kerb.c(1932): [client x.x.x.x] kerb_authenticate_user entered with user (NULL) and auth_type Kerberos
[debug] src/mod_auth_kerb.c(1277): [client x.x.x.x] Acquiring creds for HTTP/kerberos_server.example.com@REALM.EXAMPLE.COM
[debug] src/mod_auth_kerb.c(1470): [client x.x.x.x] Credentials cache FILE:/tmp/krb5cc_48 not found, create one
[error] [client x.x.x.x] Could not parse principal HTTP/kerberos_server.example.com@REALM.EXAMPLE.COM/server_hostname: Malformed representation of principal (-1765328250)
[debug] src/mod_auth_kerb.c(1598): [client x.x.x.x] Failed to obtain credentials for s4u2proxy
[debug] src/mod_auth_kerb.c(1137): [client x.x.x.x] GSS-API major_status:000d0000, minor_status:0000000d
[error] [client x.x.x.x] gss_acquire_cred() failed: Unspecified GSS failure. Minor code may provide more information (, Permission denied)

我认为问题出在主体末尾的“/ server_hostname”。在我的Kerberos keytab文件中,主体列为HTTP/kerberos_server.example.com@EXAMPLE.COM。如何更改提交给mod_auth_kerb的主体?或者有另一种方法来协调这个解析错误吗?

1 个答案:

答案 0 :(得分:7)

原来是文件系统权限问题。 keytab由root:root拥有,权限设置为仅对所有者进行读/写(0600)。因此,Apache HTTPD无法访问keytab文件。我仍然不知道mod_auth_kerb是如何提出它的上下文发起者主体的。但是,现在Apache可以读取密钥表,一切正常。