首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apache/mod_auth_gss身份验证失败

Apache/mod_auth_gss身份验证失败
EN

Server Fault用户
提问于 2015-01-09 16:09:59
回答 2查看 2.3K关注 0票数 0

如果这是错误的stackexchange站点,很抱歉。

基于文献资料 (作为参考,我也使用了这篇博客文章),我在httpd.conf中有如下内容:

代码语言:javascript
复制
# Increase max size of HTTP request headers so we are sure it can hold any SPNEGO token.
LimitRequestFieldSize 12392

# Load the module
LoadModule auth_gss_module /apps/apache2/modules/mod_auth_gss.so

# Set general log level so we get some output
LogLevel debug

<Directory "/var/www/secured"> 
    Order allow,deny 
    Allow from all 
    AuthType GSSAPI 
    AuthGSSServiceName HTTP 
    AuthGSSKeytabFile /path/to/keytab/servername.keytab 
    #AuthGSSStripDomainBS On 
    #AuthGSSStripDomainAT On 
    AuthGSSForceCase upper 
    AuthGSSDebug On 
    require valid-user 
</Directory> 

当我点击页面时,我会在浏览器中得到“未经授权的”,在apache error_log中得到以下内容:

代码语言:javascript
复制
tail -f logs/error_log 
[authz_core:debug] [pid 3657:tid 27] mod_authz_core.c(802): [client 10.138.48.42:1432] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(620): [client 10.138.48.42:1432] gss_authenticate: type = GSSAPI 
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(334): [client 10.138.48.42:1432] authenticate_user_gss called 
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(373): [client 10.138.48.42:1432] Using keytab: KRB5_KTNAME=/path/to/keytab/servername.keytab
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(411): [client 10.138.48.42:1432] Client wants GSS mech: <unknown> 
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(288): [client 10.138.48.42:1432] acquire_server_creds for HTTP@servername 
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(438): [client 10.138.48.42:1432] got server creds for: HTTP/servername.testdomain.local@
[core:error] [pid 3657:tid 27] [client 10.138.48.42:1432] gss_accept_sec_context() failed: Invalid token was supplied (No error)
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(650): [client 10.138.48.42:1432] Authentication failed. 
[core:debug] [pid 3657:tid 27] mod_auth_gss.c(592): [client 10.138.48.42:1432] note_gss_auth_failure: auth_name = <undefined>

我注意到我似乎acquire_server_creds for HTTP@servername但是got server creds for: HTTP/servername.testdomain.local@。我不知道该从哪里开始找。

这是一个Solaris 10框,Apache 2.4试图与Windows 2008域服务器对话。

Solaris服务器上的主机文件:

代码语言:javascript
复制
XXX.XXX.XXX.XXX servername.testdomain.local servername

不存在/etc/hostname文件。

EN

回答 2

Server Fault用户

发布于 2015-01-17 12:02:36

雪崩,

我是你所引用的博客文章的作者。

您所指出的问题通常是因为kerberos实现使用了系统获得的第一个名称(通常是/etc/host文件中的第一个条目)。正在发生的情况是,您有带有完全限定名的keytab,而第一个主机条目是没有限定条件的名称。在这些条目中,我在三个位置配置了完全限定名: keytab、/etc/host中的第一个条目和计算机的主机名(/etc/ hostname )。

如果您检查前面的条目,我评论说我也遇到了同样的问题。

票数 1
EN

Server Fault用户

发布于 2015-01-21 08:44:02

您的/etc/host是可以的(完全限定的名称是第一个)。检查机器中的主机名是短名还是完全限定名。只需执行主机名并检查响应。

如果名称是短的,请尝试将主机名更改为完全限定的名称:

主机名servername.testdomain.local

我认为有一个-t选项将其设置为临时的。

再见!

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/658446

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档