Gitlab加入LDAP认证 (windows AD)<03>

环境信息:

主机名称 IP 角色
AD-Server 192.168.61.237 AD服务器
gitlab 192.168.61.112 AD服务器
[root@gitlab ~]# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
[root@gitlab ~]# yum -y install gitlab-ce


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: 'AD认证'
host: '192.168.61.237'
port: 389
uid: 'SamaccountName'
method: 'plain' # "tls" or "ssl" or "plain"
bind_dn: 'cn=administrator,cn=Users,dc=iyou,dc=com'
password: 'Lahmy1c!'
active_directory: true
allow_username_or_email_login: true
block_auto_created_users: false
base: 'dc=iyou,dc=com'
user_filter: ''
EOS
重新加载配置

[root@gitlab ~]# gitlab-ctl reconfigure

查看是否能正常获取用户列表

gitlab-rake gitlab:ldap:check

参数说明:

  • host 、port :是 LDAP 服务的主机IP和端口。
  • bind_dn :管理 LDAP 的 dn。指定ldap服务器的管理员信息,即cn=账户,cn=组织单位。
  • base:表 LDAP 将以该 dn 为 节点,向下查找用户。ldap服务器的base域。
  • user_filter:表以某种过滤条件筛选用户。为空表示不过滤。

确认该用户不处于特殊状态
1.不处于“禁用账户”的状态;

2.不处于“需要首次登录修改密码”的状态;

(处于上面任意一种状态的账户在登录gitlab时都会报“Cloud not authenticate you from Ldapmain because "Invalid creadentials".”)

posted @   一毛丶丶  阅读(305)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-11-04 OpenStack Newton HA 高可用部署之部署MariaDB Galera Cluster(一)
2020-11-04 linux中vsftp提示--553 Could not create file
点击右上角即可分享
微信分享提示