Linux – Git connects to Active Directory

Git connects to Active Directory… here is a solution to the problem.

Git connects to Active Directory


Set up a Git repository on Oracle Linux 6. Users connect from Windows, Mac, and Linux using AD credentials. I want to restrict access based on AD groups. I was looking for a way to set it up. I’ve seen several options that allow fine-grained access control to repositories, but I haven’t found any option that can use AD groups to manage access.

So the question is: is this possible? Can someone point out the documentation direction that can explain the process?



Now there seem to be more options :

  • <a href=”” rel=”noreferrer noopener nofollow”>GitLab supportsLDAP authentication
  • <a href=”” rel=”noreferrer noopener nofollow”>Gogs support LDAP too


<a href=”” rel=”noreferrer noopener nofollow”>GitBlit, “an open-source, pure Java stack for managing, viewing, and servicing Git repositories,” supports LDAP authentication out of the box:

LDAP can be used to authenticate Users and optionally control Team memberships. When properly configured, Gitblit will delegate authentication to your LDAP server and will cache some user information in the usual users.conf file.

GitBlit also lists support for Windows authentication, but only when installed on Windows. And only test against local accounts.

Previous answer:

If you move your Git server to Bonobo Git Server on Windows you can use Windows authentication :

Windows Authentication

This authentication is very useful when your git server sits inside the company network and your accounts and logging information could be managed via IIS. The advantage of this approach is that your users won’t have to create another account for logging to Bonobo Git Server. They will use the existing Windows account they use on the network.

Doing this on Linux is possible, but not easy. You might have to set PAM to use LDAP or Kerberos authentication, and then do quite a lot The configuration I highly recommend checking out Bonobo.

Related Problems and Solutions