gitlab 集成openldap

2021-06-07 17:45:11 浏览数 (1)

Setting up LDAP sign-in

If you have an LDAP directory service such as Active Directory, you can configure GitLab so that your users can sign in with their LDAP credentials. Add the following to /etc/gitlab/gitlab.rb, edited for your server.

For GitLab Community Edition:

以下是我ldap的配置

  1. ### LDAP Settings
  2. ###! Docs: https://docs.gitlab.com/omnibus/settings/ldap.html
  3. ###! **Be careful not to break the indentation in the ldap_servers block. It is
  4. ###! in yaml format and the spaces must be retained. Using tabs will not work.**
  5. gitlab_rails['ldap_enabled'] = true
  6. gitlab_rails['prevent_ldap_sign_in'] = false
  7. gitlab_rails['ldap_servers'] = YAML.load <<-EOS
  8. main:
  9. label: 'LDAP'
  10. host: '192.168.x.x'
  11. port: 389
  12. uid: 'cn'
  13. encryption: 'plain'
  14. bind_dn: 'cn=admin,dc=xxx,dc=com'
  15. password: 'xxx'
  16. smartcard_auth: false
  17. active_directory: true
  18. allow_username_or_email_login: true
  19. lowercase_usernames: false
  20. base: 'ou=People,dc=xxx,dc=com'
  21. user_filter: ''
  22. EOS
  23. gitlab-ctl reconfigure
  24. gitlab-ctl restart

0 人点赞