在apache_mod_krb认证的Git [英] Git authentication over apache_mod_krb
问题描述
我使用的是用git-HTTP后端混帐回购协议。在我的Apache2位置有什么需要身份验证克隆和推动行动。当我与基础进行AuthType保护了它的位置
所有的作品是好的,混帐通过认证,可以克隆和推动,但如果我改变类型KerberosV5混帐无法访问与正确的凭据回购。如果我用我的浏览器我有机会获得什么样的位置,以保护Kerberos的。
git的克隆HTTP://user@mydomain.com/git/myapp.git
初始化空Git仓库中/tmp/myapp/.git/
密码:
错误:请求的URL返回错误:401,而访问http://user@mydomain.com/git/myapp.git/info/refs
致命的:HTTP请求失败
和Apache中的错误日志
[周五8月6日17:15:50 2010] [调试]的src / mod_auth_kerb.c(1579):客户端192.168.12.153] kerb_authenticate_user与用户名(NULL)和AUTH_TYPE进入KerberosV5
[周五8月6日17:15:50 2010] [调试]的src / mod_auth_kerb.c(1579):客户端192.168.12.153] kerb_authenticate_user与用户名(NULL)进入和AUTH_TYPE KerberosV5
混帐核心1:1.7.1-1〜bpo50 + 1的Apache2 2.2.9-10 + lenny8
中的libapache2-MOD-AUTH路边5.3-5
在袅袅的问题,因为在Debian的混帐与卷曲选项编译
ANY_AUTH
,当客户端的git尝试连接到网络服务器和先问其谈判AUTH更不能做到这一点,混帐不要尝试基本身份验证。
块引用>这将更为强劲,使用Git 2.3.1(Q1 / Q2 2015):请参见提交4dbe664 通过布赖恩·米卡尔森(
bk2204
):
远程卷曲
:回落至基本
AUTH如果协商
失败
使用的Apache服务器
mod_auth_kerb所
可以被配置为允许用户
认证或者使用协商(使用Kerberos票据)或
基本身份验证(使用Kerberos密码)。通常情况下,一会
要使用协商身份验证,如果它是可用的,但回落
基本身份验证如果票证丢失或过期。
然而,
的libcurl
将非常努力地用其他的东西比基本
AUTH,甚至通过HTTPS。结果
如果基本
和别的东西提供,的libcurl
将永远不会尝试使用基本
,即使其它选项失败。结果
教HTTP客户端code停止尝试的身份验证机制
不使用密码(当前协商
)的第一次失败后,因为若未能在第一时间,他们将永远不会成功
块引用>I'm using git repo with git-http-backend. In apache2 I have location what needs authentication for clone and push actions. When I protected it location with AuthType Basic all works is fine, git passes authentication and can clone and push, but if I change type to KerberosV5 git can't access to repo with correctly credentials. If I'm using my browser I have access to location what to protect kerberos.
git clone http://user@mydomain.com/git/myapp.git Initialized empty Git repository in /tmp/myapp/.git/ Password: error: The requested URL returned error: 401 while accessing http://user@mydomain.com/git/myapp.git/info/refs fatal: HTTP request failed
and in apache error logs
[Fri Aug 06 17:15:50 2010] [debug] src/mod_auth_kerb.c(1579): [client 192.168.12.153] kerb_authenticate_user entered with user (NULL) and auth_type KerberosV5 [Fri Aug 06 17:15:50 2010] [debug] src/mod_auth_kerb.c(1579): [client 192.168.12.153]kerb_authenticate_user entered with user (NULL) and auth_type KerberosV5
git-core 1:1.7.1-1~bpo50+1 apache2 2.2.9-10+lenny8 libapache2-mod-auth-kerb 5.3-5
解决方案Problem in curl, because git in debian was compiled with curl option
ANY_AUTH
, and when git client try connect to webserver and first ask it negotiate auth and it can't do it, git don't try basic auth.That will be more robust, with Git 2.3.1 (Q1/Q2 2015): see commit 4dbe664 by brian m. carlson (
bk2204
):
remote-curl
: fall back toBasic
auth ifNegotiate
failsApache servers using
mod_auth_kerb
can be configured to allow the user to authenticate either using Negotiate (using the Kerberos ticket) or Basic authentication (using the Kerberos password). Often, one will want to use Negotiate authentication if it is available, but fall back to Basic authentication if the ticket is missing or expired.However,
libcurl
will try very hard to use something other thanBasic
auth, even over HTTPS.
IfBasic
and something else are offered,libcurl
will never attempt to useBasic
, even if the other option fails.
Teach the HTTP client code to stop trying authentication mechanisms that don't use a password (currentlyNegotiate
) after the first failure, since if they failed the first time, they will never succeed.
这篇关于在apache_mod_krb认证的Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!