C/C++教程

CentOS7安装OpenLdap设置默认的策略

本文主要是介绍CentOS7安装OpenLdap设置默认的策略,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

策略明细

# default_ppolicy.ldif
dn: cn=default,ou=People,dc=ethnicity,dc=com
cn: default
objectClass: pwdPolicy
objectClass: person
objectClass: top
pwdAttribute: 2.5.4.35   //切记这里写版本号码不要按照网上的userPassword
pwdMinAge: 0
pwdMaxAge: 7776000
pwdInHistory: 5
pwdCheckQuality: 0
pwdMinLength: 5
pwdExpireWarning: 6480000
pwdGraceAuthNLimit: 5
pwdLockout: TRUE
pwdLockoutDuration: 300
pwdMaxFailure: 5
pwdFailureCountInterval: 30
pwdMustChange: FALSE
pwdAllowUserChange: TRUE
pwdSafeModify: FALSE
sn: dummy value
添加即可

ldapadd -x -D'cn=Manager,dc=ethnicity,dc=com' -W -H ldapi:/// -f default_ppolicy.ldif

添加默认策略的用户,这个可以根据具体情况调整

dn: uid=wulei,ou=People,dc=ethnicity,dc=com
objectClass: inetOrgPerson
uid: wulei
cn: wu lei
sn: lei
mail: wulei@gdy.com
pwdPolicySubentry: cn=default,ou=People,dc=ethnicity,dc=com
ldapadd -x -D'cn=Manager,dc=ethnicity,dc=com' -W -H ldapi:/// -f abc.ldif
# cat  /etc/openldap/slapd.conf
modulepath /usr/lib/openldap
modulepath /usr/lib64/openldap
moduleload ppolicy.la
overlay ppolicy
ppolicy_default cn=default,ou=People,dc=ethnicity,dc=com
ppolicy_hash_cleartext
ppolicy_use_lockout
这篇关于CentOS7安装OpenLdap设置默认的策略的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!