Gitlab管理之二十三–配置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服務器。正確應該會彈出如下畫面。

這裏寫圖片描述

6. 進行登陸校驗。

這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章