Kerberos+LDAP认证整合
2017-10-31 14:29
519 查看
请确保Kerberos和LDAP已经配置好了
参考个人写的文章:http://blog.csdn.net/ZhouyuanLinli/article/details/78323331
Kerberos+LDAP认证整合配置
方案:LDAP 账号管理,Kerberos进行认证。
1)采用该 LDAP作为用户认证。
只需要对用户 (如uid=test,ou=People,dc=example,dc=com)添加 userPassword成员即可。如果通过 命令行添加,需要先准备如下文件(userPassword对应的密码为123456):
dn: uid=test,ou=People,dc=example,dc=com
changetype: modify
add: userPassword
userPassword:: e1NTSEF9Ym0rZXloV1ExalB1aWNEVU1BaHlNM0hZVHh3REIrWU4K
然后执行命令
# ldapmodify -x -D 'cn=root,dc=example,dc=com' -w 12345678 -h 127.0.0.1 -f /tmp/test.ldif
。 命令执行成功后,通过
# ldapsearch -x -D 'uid=test,ou=People,dc=example,dc=com' -w 123456 127.0.0.1 -b 'ou=People,dc=example,dc=com'
确认。
2)使用 Kerberos 认证。
需要将用户的密码域做如下修改(userPassword 对应的密码由echo -n "{SASL}test@EXAMPLE.COM"
| base64生成):
dn: uid=test,ou=People,dc=example,dc=com
changetype: modify
replace: userPassword
userPassword:: e1NBU0x9dGVzdEBFWEFNUExFLkNPTQ==
执行ldapmodify -x -D 'cn=root,dc=example,dc=com'
-w 12345678 -h 127.0.0.1 -f /tmp/test.ldif应用该修改。
3)修改配置
# vim /etc/sysconfig/saslauthd
修改值
MECH=kerberos5
重启:service saslauthd restart
创建vim /etc/sasl2/slapd.conf文件
内容:
pwcheck_method: saslauthd
重启:service slapd restart
4)执行命令:service saslauthd status -l查看是否报错
执行如下操作:
# kadmin.local -q "ank -clearpolicy -randkey host/c2bde55"
# kadmin.local -q "ktadd host/c2bde55"
# service saslauthd restart
# ps -aux | grep saslauthd
# kadmin.local -q 'ank -pw 123456 test'
配置 test 用户的密码为:123456
# testsaslauthd -u test -p 123456
至此, Kerberos 认证测试成功。
执行 ldapsearch测试LDAP
认证是否成功
ldapsearch -x -D 'uid=test,ou=People,dc=example,dc=com' -w 123456 -h 127.0.0.1 -b 'ou=People,dc=example,dc=com'
参考链接:http://blog.clanzx.net/2013/09/27/ldap-kerberos.html
参考个人写的文章:http://blog.csdn.net/ZhouyuanLinli/article/details/78323331
Kerberos+LDAP认证整合配置
方案:LDAP 账号管理,Kerberos进行认证。
1)采用该 LDAP作为用户认证。
只需要对用户 (如uid=test,ou=People,dc=example,dc=com)添加 userPassword成员即可。如果通过 命令行添加,需要先准备如下文件(userPassword对应的密码为123456):
dn: uid=test,ou=People,dc=example,dc=com
changetype: modify
add: userPassword
userPassword:: e1NTSEF9Ym0rZXloV1ExalB1aWNEVU1BaHlNM0hZVHh3REIrWU4K
然后执行命令
# ldapmodify -x -D 'cn=root,dc=example,dc=com' -w 12345678 -h 127.0.0.1 -f /tmp/test.ldif
。 命令执行成功后,通过
# ldapsearch -x -D 'uid=test,ou=People,dc=example,dc=com' -w 123456 127.0.0.1 -b 'ou=People,dc=example,dc=com'
确认。
2)使用 Kerberos 认证。
需要将用户的密码域做如下修改(userPassword 对应的密码由echo -n "{SASL}test@EXAMPLE.COM"
| base64生成):
dn: uid=test,ou=People,dc=example,dc=com
changetype: modify
replace: userPassword
userPassword:: e1NBU0x9dGVzdEBFWEFNUExFLkNPTQ==
执行ldapmodify -x -D 'cn=root,dc=example,dc=com'
-w 12345678 -h 127.0.0.1 -f /tmp/test.ldif应用该修改。
3)修改配置
# vim /etc/sysconfig/saslauthd
修改值
MECH=kerberos5
重启:service saslauthd restart
创建vim /etc/sasl2/slapd.conf文件
内容:
pwcheck_method: saslauthd
重启:service slapd restart
4)执行命令:service saslauthd status -l查看是否报错
执行如下操作:
# kadmin.local -q "ank -clearpolicy -randkey host/c2bde55"
# kadmin.local -q "ktadd host/c2bde55"
# service saslauthd restart
# ps -aux | grep saslauthd
# kadmin.local -q 'ank -pw 123456 test'
配置 test 用户的密码为:123456
# testsaslauthd -u test -p 123456
至此, Kerberos 认证测试成功。
执行 ldapsearch测试LDAP
认证是否成功
ldapsearch -x -D 'uid=test,ou=People,dc=example,dc=com' -w 123456 -h 127.0.0.1 -b 'ou=People,dc=example,dc=com'
参考链接:http://blog.clanzx.net/2013/09/27/ldap-kerberos.html
相关文章推荐
- kerberos整合ldap进行服务器认证
- 使用 LDAP + Kerberos 实现集中用户认证及授权系统
- apache+svn+openldap 整合实现认证
- 配置Kerberos+LDAP整合,共用LDAP 数据库
- CDH 5.2中Impala认证集成LDAP和Kerberos
- jenkins反向代理整合ldap数据header认证
- java鬼混笔记:shiro 6、shiro和spring整合、数据库方式认证登录
- 实例使用NTLM验证整合Squid及Samba3实现AD域用户认证
- kerberos认证全程
- rhel as5环境下:postfix openldap cyrus-sasl dovecot db4 配置smtp,pop3,imap认证
- SUSE12.1 OBS-LDAP 认证配置
- openfire使用ldap认证,组的过滤设置
- 单点登录(SSO)的核心--kerberos身份认证协议技术参考
- Spring Boot整合JWT实现用户认证
- Puppet and openldap 整合
- SSM整合shiro实现多用户表多Realm统一登录认证(大章附代码)
- SpringBoot+shiro整合学习之登录认证和权限控制
- 整合spring cloud云架构 - SSO单点登录之OAuth2.0登录认证(1)
- CAS3.5 单点登录 整合数据库认证