Sunday, 9 February 2014

Steps for LDAP Client Configuration

step1 : Install directories

[root@demo ~]# yum groupinstall directory* -y
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
rhel6                                                    | 4.0 kB     00:00  
Setting up Group Process
Package 3:ypbind-1.20.4-29.el6.x86_64 already installed and latest version
Package ipa-client-2.2.0-16.el6.x86_64 already installed and latest version
Package oddjob-mkhomedir-0.30-5.el6.x86_64 already installed and latest version
Package sssd-1.8.0-32.el6.x86_64 already installed and latest version
Warning: Group directory-client does not have any packages.
Warning: Group directory-server does not have any packages.
No packages in any requested group available to install or update

[root@demo ~]# su - ldapuser5
su: user ldapuser5 does not exist

[root@demo ~]# cat /etc/passwd | grep ldapuser5

step2: Configure ldap client

[root@demo ~]# system-config-authentication

Shutting down Winbind services:                         [  OK  ]
Starting sssd:                                          [  OK  ]

you will get an pop up tab in that select the configuration shown below:




[root@demo ~]# id ldapuser5
uid=1705(ldapuser5) gid=1705(ldapuser5) groups=1705(ldapuser5)

[root@demo ~]# getent passwd ldapuser5
ldapuser5:*:1705:1705:LDAP Test User 5:/home/guests/ldapuser5:/bin/bash

[root@demo ~]# cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
i am rootuser
[root@demo ~]# cat /etc/passwd | grep student
student:x:500:500::/home/student:/bin/bash


[root@demo ~]# getent passwd ldapuser1
ldapuser1:*:1701:1701:LDAP Test User 1:/home/guests/ldapuser1:/bin/bash
[root@demo ~]#
[root@demo ~]# su - ldapuser1
su: warning: cannot change directory to /home/guests/ldapuser1: No such file or directory
-bash-4.1$ whoami
ldapuser1
-bash-4.1$ pwd
/root
-bash-4.1$ exit
logout
[root@demo ~]# showmount -e 192.168.0.254
Export list for 192.168.0.254:
/home/guests 192.168.0.0/255.255.255.0
/var/nfs     192.168.1.0/255.255.255.0,192.168.0.0/255.255.255.0
/kickstart   192.168.1.0/255.255.255.0,192.168.0.0/255.255.255.0
/var/ftp/pub 192.168.1.0/255.255.255.0,192.168.0.0/255.255.255.0


 step3:Autumount the file for ldap

[root@demo ~]# vim /etc/auto.master

at the end of the file add the line(given in red color)

# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
/net -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/home/guests /etc/auto.misc

[root@demo ~]# vim /etc/auto.misc

at the end of the file add the line (given in red color)

# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
* -fstype=nfs,rw 192.168.0.254:/home/guests/&

[root@demo ~]# service autofs stop; service autofs start; chkconfig autofs on
Stopping automount:                                     [  OK  ]
Starting automount:                                     [  OK  ]

[root@demo ~]# su - ldapuser5
[ldapuser5@demo ~]$ exit
logout

No comments:

Post a Comment