Authenticate CentOS 7 Client Machine From OpenLDAP Server

Authenticate CentOS Linux 7 Client Machine from OpenLDAP Server

Benefit to authenticate CentOS Linux 7 client machine from OpenLDAP Server is to Centralized the Linux Base environment. Use single user id to connect any CentOS Linux 7 client machine. User access own files and folder from any CentOS Linux 7 client machine.

Check the hosts file of CentOS Linux 7 client machine type the below command.
cat /etc/hosts
authenticate centos linux 7 client machine from openldap server

In the above image you can see that Host Name and Full Qualified Domain Name (Host Name + Domain Name) not edit in hosts file to resolve DNS Server IP address or any other CentOS Linux 7 client machine IP Address because DNS Server is use to resolve Host Name to IP Address and IP address to Host Name.

Check the Host Name file of CentOS Linux 7 Client Machine type the below command.
cat /etc/hostname
authenticate centos linux 7 client machine from openldap server

Edit the Name Server Addresses in "resolv.conf" file that available in "/etc/resolv.conf" directory. To Check the Name Server Addresses in "resolv.conf"  file type the below command, you can edit the "resolv.conf" file by use of vi  editor to add the Name Server Addresses.

cat /etc/resolv.conf
authenticate centos linux 7 client machine from openldap server

To Check DNS Server Full Qualified Domain Name "FQDN" is resolving type the below command.
nslookup ldap-dns.pakistan.local
Note: DNS Server and OpenLDAP Server is Same machine.

configure centos linux 7 client machine for openldap authentication

To check the CentOS Linux 7 client machine IP address type the below command.
cat /etc/sysconfig/network-scripts/ifcfg-ens33
Note: DNS1 address must be OpenLDAP Server IP Address.

configure centos linux 7 client machine for openldap authentication

To Install OpenLDAP client packages for Authenticate Centos Linux 7 client machine from OpenLDAP Server type the below command.
yum install -y openldap-clients nss-pam-ldapd
how authenticate centos linux 7 client machine from openldap server

OpenLDAP client package has successfully installed.

how authenticate centos linux 7 client machine from openldap server

To Authenticate CentOS Linux 7 client machine form OpenLDAP Server type the below command.
authconfig-tui
how authenticate centos linux 7 client machine from openldap server

Select  Below Options then press next.
Use LDAP
Use LDAP Authentication

how authenticate centos linux 7 client machine from openldap server

Set OpenLDAP Server Full Qualified Domain Name and Base DN (Domain Name) as mention below then press OK.
Server: ldap://ldap-dns.pakistan.local/
Base DN: dc=pakistan,dc=local
how authenticate centos linux 7 client machine from openldap server

Type the below commands to verify that users are authenticate from OpenLDAP Server to CentOS Linux 7 client machine.
getent passwd user1
getent passwd user2
getent passwd owais
how authenticate centos linux 7 client machine from openldap server

In the above image you can see that OpenLDAP users has successfully authenticated.
To login in CentOS Linux 7 client machine from OpenLDAP user "user1" type the below command.
su - user1
how authenticate centos linux 7 client machine from openldap server

CentOS Linux 7 Client Machine Successfully Authenticate from OpenLDAP Server.
To Mount the Home Directory of users in CentOS Linux 7 client machine from OpenLDAP Server click on >>Read.
Thanks for read this Article

Comments