[root@c720141 ~]# cd /etc/gitlab/
gitlab_rails[‘ldap_enabled‘] = true
###! **remember to close this block with ‘EOS‘ below**
gitlab_rails[‘ldap_servers‘] = YAML.load <<-‘EOS‘
main: # ‘main‘ is the GitLab ‘provider ID‘ of this LDAP server
label: ‘aishangwei.net‘
host: ‘ldap.aishangwei.net‘
port: 389
uid: ‘sAMAccountName‘
uid: ‘uid‘
bind_dn: ‘cn=admin,dc=ldap,dc=aishangwei,dc=net‘
password: ‘xiodi.cn123‘
method: ‘plain‘ # "start_tls" or "simple_tls" or "plain"
# verify_certificates: true
active_directory: true
allow_username_or_email_login: false
# lowercase_usernames: false
# block_auto_created_users: false
base: ‘DC=ldap,DC=aishangwei,DC=net‘
user_filter: ‘‘
gitlab-ctl reconfigure
原文:https://www.cnblogs.com/zangxueyuan/p/9241273.html