Topic 7

Date: 3/1/2017
Lightweight Directory Access Protocol (LDAP)
Linux System Administration

Exercises: LDAP client on CentOS

  • Make sure CentOS7 VM is down, then clone it into a new VM, centn01:
    virsh list
    virsh shutdown CentOS7
    virt-clone --connect=qemu:///system -o CentOS7 -n centn01 -f /home/hostadm/KVM/centn01.img

  • Start centn01 and login to the console:
    virsh start centn01
    virsh console centn01  
    Correct the VM hostname by editing file /etc/hostname .
    Reboot centn01.

  • On master VM, export directory /NFS/home to host centn01 as follows.
    Edit file /etc/exports, and add line
    /NFS/home  centn01(rw)
    Run command
    exportfs -a

  • On centn01, install package for NFS services:
    yum install nfs-utils

  • On centn01, install autofs:
    yum install autofs 

  • Edit file /etc/auto.master and add the following line:
    /NFS   /etc/auto.exports  --timeout 60
    Edit file /etc/auto.exports and put the following line in it:
    home  -rw,fstype=nfs4  master:/NFS/home
    Create mounting point /NFS, and restart autofs:
    mkdir /NFS
    systemctl enable autofs
    systemctl start  autofs

  • On centn01, install LDAP client packages:
    yum install openldap-clients nss-pam-ldapd

  • Configure LDAP client:
    authconfig --enableldap --enableldapauth --disablenis --enablecache --ldapserver=master --ldapbasedn=dc=dom02,dc=linux,dc=class --updateall

    Check if LDAP user mike is recognizable on centn01
    id mike

    Figure out the IP address of centn01 and ssh to it as user mike, for example:
    ssh mike@

  • Take me to the Course Website