当前位置:网站首页>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 .
边栏推荐
- Building 64 bit wampserver and DVWA in win7 virtual machine
- 人脸识别pip 安装dlib库失败
- MATLAB中stairs函数使用
- Common tools download address
- 无限生长,我们都将奔赴未来 | InfoQ中国成立15周年
- Sendmail Dovecot 邮件服务器
- PHP get (remote) large file method record
- 890. 查找和替换模式
- On 3dsc theory and application of 3D shape context feature
- Construction and construction of meta Universe System
猜你喜欢

Reading mysql45 lecture - self summary (part)

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

基于C#的安全聊天工具设计

How the ArrayList collection implements ascending and descending order

人脸识别pip 安装dlib库失败

分布式存储探索

Mcuxpresso develops NXP rt1060 (3) -- porting lvgl to NXP rt1060

The reason why scanf return value is ignored and its solution

AcWing 135. Maximum subsequence sum (prefix sum + monotone queue to find the minimum value of fixed length interval)

redis 總結
随机推荐
Why check the @nonnull annotation at run time- Why @Nonnull annotation checked at runtime?
M-Arch(番外11)GD32L233评测-PWM驱动有源蜂鸣器
FPGA key experiment
Malicious code analysis practice - lab03-03 Exe basic dynamic analysis
AcWing 1995. 见面与问候(模拟)
tensorflow 2.x 多分类混淆矩阵及评价指标计算方法(精确率、召回率、f1分数)
scanf返回值被忽略的原因及其解决方法
The reason why scanf return value is ignored and its solution
AcWing 131. 直方图中最大的矩形(单调栈经典运用 模板)
file_ get_ Contents() JSON after reading_ Decode cannot be converted to array
DS18B20数字温度计 (一) 电气特性, 寄生供电模式和远距离接线
AI - face
深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet)
FPGA开发——Hello_world例程
Php中redis的keys问题
Using the echart plug-in to dynamically refresh charts in uview/uni-app
Clj3-100alh30 residual current relay
程序分析与优化 - 6 循环优化
AcWing 132. 小组队列(队列模拟题)
PHP download station B video