GitLite和Git可以使用LDAP和NOT SSH密钥 [英] Can GitoLite and Git Using LDAP and NOT SSH keys
问题描述
我的公司正在研究使用git和gitolite,但不想使用SSH密钥,并且喜欢使用LDAP。可以这样做吗?
my firm is looking at using git and gitolite but does not want to use SSH keys and work like to use LDAP.. Can this be done??
我从来没有见过这样做.. Everyplace我有这个设置,总是使用SSH密钥
I never seen this done.. everyplace I have this setup with always used SSH keys
推荐答案
是的,你可以没有任何问题。
Yes, you can do it without any issue.
你只需要你的 Apache做认证部分(因为gitolite只是一个授权层),并调用 gitolite-shell
而不是 git-http-backend
,其中 REMOTE_USER
由Apache设置(和用于 gitolite-shell
)。
You simply need your Apache to do the authentication part (since gitolite is only an authorization layer), and call gitolite-shell
instead of git-http-backend
, with REMOTE_USER
set by Apache (and used by gitolite-shell
).
见a 在Linux上与Ubuntu搭配使用Ldap的Git 。
httpd.conf
的主要部分为:
The main part of the httpd.conf
being:
SetEnv GIT_PROJECT_ROOT @H@/repositories
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GITOLITE_HTTP_HOME @H@
ScriptAlias /hgit/ @H@/sbin/gitolite-shell/
SetEnv GIT_HTTP_BACKEND "@H@/usr/local/apps/git/libexec/git-core/git-http-backend"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Location /hgit>
SSLOptions +StdEnvVars
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
#AllowOverride All
order allow,deny
Allow from all
AuthName "LDAP authentication for Smart HTTP Git repositories"
AuthType Basic
AuthBasicProvider myldap companyldap
AuthzLDAPAuthoritative Off
Require valid-user
AddHandler cgi-script cgi
</Location>
( @H @
只是一个模板价值,将被你的路径所取代)
(@H@
is just a template value, to be replaced by your path)
这篇关于GitLite和Git可以使用LDAP和NOT SSH密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!