gitlab详细配置ldap

本文将指导您完成从LDAP安装到GitLab配置的全过程,包括修改GitLab配置文件以集成LDAP,并最终进行登录测试,确保LDAP认证顺利进行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、ldap安装
2、gitlab安装
3、gitlab修改配置

vim /srv/gitlab/config/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: '10.7.30.63'
     port: 389
     uid: 'cn'
     bind_dn: 'cn=Manager,dc=xinhua,dc=org'
     password: '111111'
     encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
     verify_certificates: true
     active_directory: true
     allow_username_or_email_login: true
     lowercase_usernames: false
     block_auto_created_users: false
     base: 'cn=Manager,dc=xinhua,dc=org'
     user_filter: ''
     attributes:
       username: ['uid', 'userid', 'sAMAccountName']
       email: ['mail', 'email', 'userPrincipalName']
       name: 'cn'
       first_name: 'givenName'
       last_name:  'sn'
EOS

gitlab-ctl reconfigure                               #重载配置文件
gitlab-rake gitlab:ldap:check                        #检查是否能够正常获取用户信息

4、修改配置
这里写图片描述
最后测试登录

参考资料:

https://docs.gitlab.com/ee/administration/auth/ldap.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值