Fedora 16
Sponsored Link

Configure LDAP Client2011/11/16

  Configure LDAP Client
[root@www ~]#
yum -y install openldap-clients nss_ldap
[root@www ~]#
vi /etc/openldap/ldap.conf
# add at the last line
# LDAP server's URI

URI ldap://10.0.0.100/
# specify Suffix

BASE dc=srv,dc=world
TLS_CACERTDIR /etc/openldap/cacerts
[root@www ~]#
vi /etc/nss_ldap.conf
# line 15: make it comment

#
host 127.0.0.1
# line 18: specify Suffix

base dc=
srv
,dc=
world
# add at the last line

uri ldap://10.0.0.100/
ssl no
tls_cacertdir /etc/openldap/cacerts
[root@www ~]#
vi /etc/pam_ldap.conf
# line 17: make it comment

#
host 127.0.0.1
# line 20: specify Suffix

base dc=
srv
,dc=
world
# add at the last line

uri ldap://10.0.0.100/
ssl no
tls_cacertdir /etc/openldap/cacerts
pam_password crypt
[root@www ~]#
vi /etc/pam.d/system-auth
# add like follows

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth
required
pam_env.so

auth
sufficient
pam_unix.so nullok try_first_pass

auth
requisite
pam_succeed_if.so uid >= 500 quiet

auth
sufficient
pam_ldap.so use_first_pass

auth
required
pam_deny.so
account
required
pam_unix.so

account
sufficient
pam_localuser.so

account
sufficient
pam_succeed_if.so uid < 500 quiet

account
[default=bad success=ok user_unknown=ignore] pam_ldap.so

account
required
pam_permit.so
password
requisite
pam_cracklib.so try_first_pass retry=3 type=

password
sufficient
pam_unix.so sha512 shadow nullok try_first_pass use_authtok

password
sufficient
pam_ldap.so use_authtok

password
required
pam_deny.so
session
optional
pam_keyinit.so revoke

session
required
pam_limits.so

session
[success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid

session
required
pam_unix.so

session
optional
pam_ldap.so

# add if you need ( create home directory automatically if it's none )

session
optional
pam_mkhomedir.so skel=/etc/skel umask=077
[root@www ~]#
vi /etc/nsswitch.conf
passwd:
files
ldap
# line 33: add

shadow:
files
ldap
# add

group:
files
ldap
# add
netgroup:
nisplus
ldap
# line 57: add
[root@www ~]#
vi /etc/sysconfig/authconfig
# line 19: change

USELDAP=
yes
[root@www ~]#
shutdown -r now
www.srv.world login:
fedora
# a user on LDAP

Password:
Creating directory '/home/fedora'.
[fedora@www ~]$
# just logined

[fedora@www ~]$
# try to change LDAP password

Changing password for user fedora.
Enter login(LDAP) password:
# current one

New password:
# new one

Retype new password:
LDAP password information changed for fedora
passwd: all authentication tokens updated successfully.
Matched Content