Git authentication over apache_mod_krb

后端 未结 3 899
清歌不尽
清歌不尽 2021-01-13 18:02

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

3条回答
  •  轮回少年
    2021-01-13 19:00

    It's something weird in libcurl, not a problem in Git. There is a workaround. Libcurl doesn't enable any authentication code if you don't pass username and password to the library. This happens if you use negotiate (kerberos) too which doesn't require username and password. The simple solution:

    echo http://x:x@git.example.com > ~/.git-credentials
    git config --global credential.helper store
    

    x:x is the username and password. You can use any random string there. It's only needed to enable the code path to authentication in libcurl. Then kerberos will work (works for me :) ).

提交回复
热议问题