当前位置:网站首页>Drqueueonrails integrated LDAP authentication
Drqueueonrails integrated LDAP authentication
2022-06-12 11:14:00 【Brother Xing plays with the clouds】
Doing it colony Encountered in rendering management software LDAP problem ,DrQueueOnRails yes DrQueue Of ruby web Interface , Only LDAP A verification method , You have the following installation steps .
Catalog
- 1 install LDAP
- 2 modify LDAP The configuration file
- 3 modify slapd.conf
- 4 ldap_bind: Invalid credentials (49) Wrong problem solving
install LDAP
yum install openldap-servers openldap-clientsModify hostname :
hostname master.local.com
sysctl -w kernel.hostname=master.local.com
echo '192.168.8.123 master.local.com master' >> /etc/hosts
sed -i 's/HOSTNAME=.*$/HOSTNAME=master.local.com/g' /etc/sysconfig/networkmodify LDAP The configuration file
vim /etc/openldap/ldap.conf
BASE dc=local.com
URI ldap://192.168.8.123
cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
chown -R ldap:ldap /var/lib/ldapmodify slapd.conf
vim /etc/openldap/slapd.conf
Find and modify the following :
suffix "dc=local.com"
rootdn "cn=master,dc=local.com"
rootpw geek #ldapadd Time to use the password , Use two in the middle TAB key Test the configuration file for correctness :
slaptest -u -f /etc/openldap/slapd.conf
config file testing succeededCreate a user to be authenticated :
useradd geek
echo '123456' | passwd --stdin geekInstall the migration tool :
yum -y install migrationtoolsSome scripts for migrating user related information will be placed in /usr/share/migrationtools Next Modify the migration script :
vim /usr/share/migrationtools/migrate_common.ph
# Default DNS domain
$DEFAULT_MAIL_DOMAIN = "local.com";
# Default base
$DEFAULT_BASE = "dc=local.com";Create basic data file :
cd /usr/share/migrationtools/
./migrate_base.pl > base.ldifedit base.ldif file , Delete other entries , Keep the following information :
dn: dc=local.com
dc: local.com
objectClass: top
objectClass: domain
dn: ou=People,dc=local.com
ou: People
objectClass: top
objectClass: organizationalUnit
dn: ou=Group,dc=local.com
ou: Group
objectClass: top
objectClass: organizationalUnitCreate user database file :
./migrate_passwd.pl /etc/passwd ./user.ldifedit user.ldif file , Only keep geek User related entries :
dn: uid=geek,ou=People,dc=local.com
uid: geek
cn: geek
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$6$tFEuTisK$PA0x.Ib1nOmiafK4wedqTnT06nQGJxVnzzpHQYu1O8SPXy5o32KkXKzzkn3w1LM0vpauFgjDQ4FudpnoS2t6O.
shadowLastChange: 15907
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 500
gidNumber: 500
homeDirectory: /home/geekCreate a user group database file :
./migrate_group.pl /etc/group groups.ldifedit groups.ldif file , Only keep geek Group entries :
dn: cn=geek,ou=Group,dc=local.com
objectClass: posixGroup
objectClass: top
cn: geek
userPassword: {crypt}x
gidNumber: 500Start the service :
/etc/init.d/slapd restart
chkconfig slapd onAdd... In turn base.ldif、user.ldif、groups.ldif To LDAP in :
ldapadd -D "cn=master,dc=local.com" -W -x -f base.ldif
Enter LDAP Password: # Enter in /etc/openldap/slapd.conf in rootpw Item value .
ldap_bind: Invalid credentials (49)ldap_bind: Invalid credentials (49) Wrong problem solving
If the above error occurs , Check whether the password corresponds to . Or regenerate slapd.d Configuration data under :
rm -fr /etc/openldap/slapd.d/*
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
chown -R ldap:ldap /etc/openldap/slapd.d/
/etc/init.d/slapd restartSo there's no problem .
edit DrQueueOnRails Directory config Under the env file :
vim .../DrQueueOnRails/config/environment.rb
# LDAP variables
ENV['LDAP_TREEBASE'] ||= "dc=local.com"
ENV['LDAP_HOST'] ||= "master.local.com"
ENV['LDAP_PORT'] ||= "389"
ENV['LDAP_FILTER'] ||= "uid"
ENV['LDAP_ATTRS'] ||= "cn"
# user status, quota (disk space in GB), job priorities
ENV['USER_STATUS'] ||= "demo,student,advanced,admin,ldapuser1" # Add a new user here
ENV['USER_QUOTA'] ||= "0.5,5,15,35,55,55" # User's disk quota
ENV['USER_PRIO'] ||= "100,500,750,1000,2000,2000" # The priority of the user when executing a task
ENV['USER_ADMIN_PW'] ||= "password"After the change, try again db once . Add... To the database ldap User record :
mysql -uroot -p
use DrQueueOnRails;
insert into profiles(name,email,avatar,ldap_account,status,accepted) values('Geek Account','[email protected]','NULL','geek','geek','0');restart apache, You can use it ldap The user logged in .
边栏推荐
- (37) How bee uses different data source instances at the same time
- 架构训练模块 7
- MySQL锁查漏补缺
- AcWing 132. Group queue (queue simulation question)
- 【CF1392D】D. Omkar and Bed Wars(环形与后效性dp)
- DS18B20数字温度计 (一) 电气特性, 寄生供电模式和远距离接线
- Collation of common functions in JS
- DrQueueOnRails 集成 LDAP 验证
- Assign a specified amount to a specified number of people at random
- 元宇宙系统搭建与构造
猜你喜欢

Index query efficiency of MySQL

Don't swallow rice with vinegar! Teach you 2 moves to make the fish bones "run out" safely

Malicious code analysis practice - lab03-01 Exe basic dynamic analysis

Vite Basics

^33变量提升和函数提升面试题

记录一下使用JPA时遇到的坑

k52.第一章 基于kubeadm安装kubernetes v1.22 -- 集群部署

890. 查找和替换模式

SOT23(Small Outline Transistor)

深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet)
随机推荐
Redis summary
Handwritten common interview questions
InfoQ 极客传媒 15 周年庆征文|position:fixed 虚拟按键触发后无法生效问题分析及解决方案探究
Clickhouse column basic data type description
On 3dsc theory and application of 3D shape context feature
VirtualBox 虚拟机因系统异常关机虚拟机启动项不见了
MySQL锁查漏补缺
Common configuration commands for Cisco network device security management
Distributed storage exploration
Clj3-100alh30 residual current relay
模块8作业
Error during session start; please check your PHP and/or webserver log file and configure your PHP
MySQL performance test (slow query log)
Epidemic home office experience | community essay solicitation
Malicious code analysis practice - lab03-03 Exe basic dynamic analysis
Leetcode2154. Multiply the found value by 2 (binary search)
Telecommuting with cpolar (2)
【CF1392D】D. Omkar and Bed Wars(环形与后效性dp)
M-Arch(番外10)GD32L233评测-SPI驱动DS1302
AcWing 135. Maximum subsequence sum (prefix sum + monotone queue to find the minimum value of fixed length interval)