够详细。。各类应用怎样使用openldap进行账号统一管理?看完这篇就够了。

以下配置环境都是Centos7.9

一、svn接入openldap认证

搭建svn的步骤省略,可看我之前的文章。。。

[root@localhost conf.d]cat subversion.conf
#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module modules/mod_authz_svn.so
# 在早期的Httpd版本,需要配置需要加载的模块,当前版本不需要
<Location /svn>
  DAV svn
  SVNListParentPath on
  SVNParentPath /home/svnroot
  AuthType Basic
  AuthName "Authorization"
  #AuthUserFile /home/svnroot/passwd
  AuthzSVNAccessFile /home/svnroot/authz
  Satisfy all
  Require valid-user

  # 定义验证方式,这里同时使用ldap和file的方式,当ldap找不到的用户,会使用file中的用户进行验证。
  AuthBasicProvider ldap
  # 在早期版本中还会有这个参数,用于设置是否仅使用ldap的方式进行验证用户信息,默认是on,这个版本不需要
  # AuthzLDAPAuthoritative off
  # 绑定LDAP的DN
  AuthLDAPBindDN "cn=admin,dc=test,dc=com"
  # 配置LDAP的管理员密码
  AuthLDAPBindPassword "123456"
  #搭建的LDAP url地址
  AuthLDAPURL "ldap://192.168.1.10:389/ou=People,dc=test,dc=com?uid?sub?(objectClass=*)"

  Options Indexes FollowSymLinks
  Order allow,deny
  Allow from all
</Location>

二、ftp接入openldap认证

搭建ftp服务的步骤省略,可看我之前的文章。。。

[root@agent ~]# yum -y install openldap-clients nss-pam-ldapd pam_ldap
[root@agent ~]# vim /etc/nslcd.conf

uri ldap://192.168.1.10/
ldap_version 3
base dc=test,dc=com
ssl no
binddn cn=admin,dc=test,dc=com
bindpw 123456

[root@agent ~]# vim /etc/pam.d/vsftpd.vu

auth       required     pam_ldap.so
account    required     pam_ldap.so

[root@agent ~]# vim /etc/openldap/ldap.conf

host    192.168.1.10
BASE    dc=test,dc=com
URI     ldap://192.168.1.10
binddn  cn=admin,dc=test,dc=com
bindpw  123456

systemctl restart nslcd
systemctl restart vsftpd

三、gitlab接入openldap认证

gitlab搭建过程请看我之前的文章。。。

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: '192.168.1.10'
    port: 389
    uid: 'uid'
    bind_dn: 'cn=admin,dc=test,dc=com'
    password: '123456'
    encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
    verify_certificates: true
    smartcard_auth: false
    active_directory: true
    allow_username_or_email_login: true
    lowercase_usernames: false
    block_auto_created_users: false
    base: 'ou=People,dc=test,dc=com'
    user_filter: ''
    attributes:
     username: ['uid', 'userid', 'sAMAccountName']
     email: ['mail', 'email', 'userPrincipalName']
     name: 'cn'
     first_name: 'givenName'
     last_name:  'sn'
    ## EE only
     group_base: ''
     admin_group: ''
         sync_ssh_keys: false
  EOS

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值