Gitlab 配置LDAP身份认证
vi /etc/gitlab/gitlab.rb
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: 'LDAP'
host: '172.16.100.230'
port: 389
uid: 'CN'
bind_dn: 'CN=LK-LDAP,OU=深圳多多公司,DC=abcd,DC=com'
password: 'passwdpasswd'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
verify_certificates: false
smartcard_auth: false
active_directory: true
#smartcard_ad_cert_field: 'altSecurityIdentities'
#smartcard_ad_cert_format: null # 'issuer_and_serial_number', 'issuer_and_subject' , 'principal_name'
allow_username_or_email_login: true
lowercase_usernames: false
block_auto_created_users: false
base: 'OU=研发一部,OU=产品研发中心,OU=深圳多多公司,DC=abcd,DC=com'
user_filter: ''
## EE only
#group_base: ''
#admin_group: ''
# sync_ssh_keys: false
--------------------------------------------------------------------------------------------
gitlab-ctl reconfigure
运行后最后一行为“gitlab Reconfigured!”才说明是加载新配置成功,
获取用户列表
gitlab-rake gitlab:ldap:check
gitlab-ctl restart
bind_dn: 'CN=LK-LDAP,OU=深圳多多公司,DC=abcd,DC=com'
目录层级理解:用户名--》组织单位—》域—》com
base: 'OU=研发一部,OU=产品研发中心,OU=深圳多多公司,DC=abcd,DC=com'
目录层级理解:OU 代表组织单位,从最小一层目录起