How to configure password openldap server in Red Hat Enterprise Linux 5?
Article ID: 48288 - Created on: Feb 28, 2009 8:43 AM - Last Modified: Jul 11, 2011 11:28 AM
- Although it is possible to apply password policies using "shadow" attributes like (shadowLastChange, shadowMin, shadowMax, shadowWarning, shadowInactive, shadowExpire ) provided in shadowAccount objectclass, one drawback is that it cannot used with the default policy. Everything needs to set manually for each user.
Environment
- Red Hat Enterprise Linux 5
- openldap-servers-2.3.43-3.el5
- openldap-servers-overlays-2.3.43-3.el5
- openldap-2.3.43-3.el5
- openldap-clients-2.3.43-3.el5
Resolution
Here are the sample for enabling password policies in openldap.
1. Refer to the following sample for configuration of the /etc/openldap/slapd.conf file:
# Include ppolicy schema in schema section of slapd.conf file include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema include /etc/openldap/schema/ppolicy.schema allow bind_v2 pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args loglevel 296 #uncomment the following lines in dynamic backend modules: modulepath /usr/lib/openldap moduleload ppolicy.la # Following access directives are required to implement policy: access to attrs=userPassword by self write by anonymous auth by * none access to attrs=shadowLastChange by self write by * read access to * by * read ####################################################################### # ldbm and/or bdb database definitions ####################################################################### database bdb suffix "dc=example,dc=com" rootdn "cn=root,dc=example,dc=com" rootpw secret directory /var/lib/ldap/ index objectClass eq,pres index ou,cn,mail,surname,givenname eq,pres,sub index uidNumber,gidNumber,loginShell eq,pres index uid,memberUid eq,pres,sub index nisMapName,nisMapEntry eq,pres,sub index entryCSN,entryUUID eq # define the default policy overlay ppolicy ppolicy_default "cn=default,ou=policies,dc=example,dc=com" ppolicy_use_lockout
To make openldap password policies work, the ppolicy.la module should be loaded from slapd.conf file. This module is provided by the openldap-servers-overlays package and will available only if this package is installed on the LDAP server.
2. Once slapd.conf is configured, add some records to the ldap server to test policies. Here is a sample ldif file.
# example.com dn: dc=example,dc=com dc: example description: Root LDAP entry for example.com objectClass: dcObject objectClass: organizationalUnit ou: rootobject # policies, example.com dn: u=policies,dc=example,dc=com objectClass: organizationalUnit objectClass: top ou: policies # default, policies, example.com dn: cn=default,ou=policies,dc=example,dc=com objectClass: top objectClass: device objectClass: pwdPolicy cn: default pwdAttribute: userPassword pwdInHistory: 6 pwdCheckQuality: 1 pwdMinLength: 8 pwdMaxFailure: 4 pwdLockout: TRUE pwdLockoutDuration: 1920 pwdGraceAuthNLimit: 0 pwdFailureCountInterval: 0 pwdMustChange: TRUE pwdAllowUserChange: TRUE pwdSafeModify: FALSE pwdMaxAge: 172800 pwdExpireWarning: 86400 # jery, example.com dn: uid=jery,dc=example,dc=com uid: jery cn: example jery objectClass: account objectClass: posixAccount objectClass: top objectClass: pwdPolicy loginShell: /bin/bash gecos: example jery uidNumber: 1011 gidNumber: 1011 homeDirectory: /home/jery pwdAttribute: userPassword userPassword: {SSHA}06TS/1t/FZUZ5zxWYnDW9Zcz9NFPNqeN
3. slapadd -l example.ldif
4. This is an optional step, to avoid warning massages while starting the ldap daemon for the first time.
chmod -R ldap.ldap /var/lib/ldap/*
5. Restart the slpad service.
# service ldap startClient side configuration
1. Run the "authconfig-tui" command.
2. Select "Use LDAP" in the User Information Section and select "Use LDAP Authentication" from the authentication section.
3. Click Next. Add IP/hostname of the LDAP server in server and add "Base BN" for directory.
server: ldap://server1.example.com/ Base DN: dc=example,dc=com
Click ok.
4. To make the policies work on the ldap client, please add the following lines in the /etc/ldap.conf file:
pam_lookup_policy yes pam_password clear
Save and exit.
Comments
1. There are two ways password policy can be applied to individual objects
- The pwdPolicySubentry in a user's object - If a user's object has a pwdPolicySubEntry attribute specifying the DN of a policy object, then the policy defined by that object is applied.
- Default password policy - If there is no specific pwdPolicySubentry set for an object, and the password policy module was configured with the DN of a default policy object and if that object exists, then the policy defined in that object is applied.
Refer 'man slapo-ppolicy' for more information.
2. If the ppolicy_default directive is not defined (in the slapd.conf file), and there is no specific password policy for the user, then no password policy will be applied for that user entry. This strategy could be used to enable password policies for a limited number users or class of users.
3. The password policies will work only if the user logged in and changed his password first time.
4. The "pwd" attributes take values in seconds, so "pwdMaxAge: 172800" will expire user password after 48 hours and the password expiry warning will be given after 24 hours "pwdExpireWarning: 86400".
5. The ldap server needs to receive the new password in plain text to enforce password length and strength. For this, pam_password has to be 'clear'.
6. Ensure that pwdGraceAuthNLimit is set to 0, setting this to any positive value will allow the user to login without enforcing password change - till the number of grace logins expire. This can confuse admins, who expect the password change to be enforced.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23757700/viewspace-713412/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Red Hat Enterprise Linux Server 7.4 安裝LinuxServer
- How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7Linux
- How to disable transparent Hugepage (THP) on Red Hat Enterprise Linux 8?Linux
- Red Hat Enterprise LinuxLinux
- 從 Red Hat Enterprise Linux 2.1 AS升級到 Red Hat Enterprise Linux 3Linux
- Red Hat Enterprise Linux 7.4Linux
- Red Hat Enterprise Linux Server release 6.2配置被動yumLinuxServer
- Red Hat Enterprise Linux 5產品線終結Linux
- asm 包下載地址 Red Hat Enterprise Linux5ASMLinux
- Oracle9i (9.2.0.4.0) Installation on Red Hat Enterprise Linux 5OracleLinux
- Red Hat Enterprise Linux 9的簡介Linux
- Red Hat Enterprise Linux 7的新功能Linux
- Red Hat Enterprise Linux使用資源的限制Linux
- Red Hat Enterprise Linux AS4-U3硬碟Linux硬碟
- [zt]Oracle9i (9.2.0.4.0) Installation on Red Hat Enterprise Linux 5 (RHEL5)OracleLinux
- Red Hat Enterprise Linux 6官方中文文件Linux
- Why is gam_server using up 100% of my CPU on Red Hat Enterprise Linux 4GAMServerLinux
- Grid Control Installation On Red Hat Enterprise LinuxLinux
- Migrating Red Hat Linux 2.1 or 3.0 to Red Hat Linux 4.0Linux
- Red Hat Enterprise Linux 10 下載 - 紅帽企業 LinuxLinux
- Xmanager2.0連線不上遠端的Red Hat Enterprise Linux5Linux
- Red Hat Enterprise Linux Server release 6.2wwwn號及光纖卡驅動查詢LinuxServer
- ORACLE Install (10g r2) FOR Red Hat Enterprise Linux Server release 5.5 (64 bit)OracleLinuxServer
- 《Red Hat Enterprise Linux 9 系統管理實戰》簡介Linux
- Red Hat Enterprise Linux AS 5.3 下配置裸裝置(raw device)Linuxdev
- 在Red Hat Enterprise Linux中有什麼型別的核心?Linux型別
- red hat enterprise linux(rhel) 3 、4、 5對應的asmlib包下載網址LinuxASM
- 【Linux】Virtualbox 安裝 Red hat Enterprise Linux 6.4-64位Linux
- 在Red Hat Linux Server 6上能否使用ASMLib?LinuxServerASM
- 在red hat enterprise linux 5.4上安裝oracle11gLinuxOracle
- HP 4411s Install Red Hat Enterprise Linux 5.8) Wireless DriverLinux
- Red Hat Enterprise Linux 6使用 XDMCP (Xmanager)的一些設定Linux
- G005-OS-INS-02 Red Hat Enterprise Linux V8.2 安裝Linux
- 變更RHEL(Red Hat Enterprise Linux 5.8)更新源使之自動更新Linux
- How to Configure the DNS Server for 11gR2 SCAN On LinuxDNSServerLinux
- Red Hat Linux 入門指南!(轉)Linux
- Oracle9.2.0.4 在 Red Hat Enterprise 4上的安裝Oracle
- linux上無線網路卡配置(Red Hat Enterprise Linux 5上Intel PRO/Wireless 2200BG配置)LinuxIntel