配置Gitlab使用LDAP认证

1. 通过SSH登陆Gitlab服务器。


2. 进行以下配置文件夹。

[root@c720141 ~]# cd /etc/gitlab/


3. 打开gitlab.rb配置文件,并加入以下配置。

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: ''


4. 保存配置文件并执行下列命令

gitlab-ctl reconfigure


5. 下一步校验工作,在浏览器中打开Gitlab服务器。正确应该会弹出如下画面。

image

6. 进行登陆校验

image

猜你喜欢

转载自www.cnblogs.com/zangxueyuan/p/9241273.html