gitlab接入ldap

2021-04-28 17:51:32 浏览数 (1)

1、登录git部署主机

2、修改gitlab配置文件 vim /etc/gitlab/gitlab.rb,打开配置文件

ldap_sync_work_cron ldap_group_sync_work_cron

2、修改gitlab配置文件 vim /etc/gitlab/gitlab.rb,不要忘记EOS!!

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: 'LDAP' host: '172.21.16.44' port: 389 uid: 'uid' bind_dn: 'cn=Manager,dc=kingxunlian,dc=com' password: '***' encryption: 'plain' # "start_tls" or "simple_tls" or "plain" verify_certificates: true smartcard_auth: false active_directory: false allow_username_or_email_login: true lowercase_usernames: false block_auto_created_users: false base: 'ou=People,dc=kingxunlian,dc=com' user_filter: '(olcAllows=True)' attributes: username: ['uid', 'cn'] email: ['mail', 'email'] name: 'displayName' ## EE only group_base: 'ou=Group,dc=kingxunlian,dc=com' admin_group: 'cn=Admin,ou=Group,dc=kingxunlian,dc=com' sync_ssh_keys: false EOS

3、完成后重启gitlab

gitlab-ctl reconfigure gitlab-rake gitlab:ldap:check

0 人点赞