How to use LDAP “getent” Command

 The “getent” is a short form of “get entries from the LDAP database”.

“getent” is a Linux command that allows users to fetch details from LDAP  databases. The “getent” uses the same service name as the system, and it will display all user details and network information.

  • passwd: can be used to check the user’s username, user’s ID, home folder, and full name.
  • groups: shows all the groups of your Linux system.
  • services: gives information on all Linux services that are configured on your system.
  • networks: shows the networks of your system.
  • protocols: tells us about our network protocols.

This post is focusing on how to fetch data from different databases.

Syntax:

Here’s the syntax of the “getent” command:

getent [database] [databse_name]

Below are the use of  “getent” Command:


getent passwd:

Use “passwd” as a database to get the information of the currently logged user. It displays the username, user’s id, and folder name. Run the command:

getent passwd {user}

getent passwd appsol

getent group:

If want to get all group details on Linux, use “group” with the “getent” command:

getent group

getent services:

Use “services” with the port number to find the service name and its protocol, For instance:

FTP-data server uses port no. 20 with TCP protocol.

An FTP server uses port no. 21 with TCP protocol.

SSH server uses port no. 2 with TCP protocol.

getent services 20

getent services 21

getent services 22



getent networks:

Use the “networks” option to check the network and IP address of your system.

getent networks


getent hosts:

Use the “hosts” option to get the IP address. The hostname of my Linux system is “apppsolworld”. 

getent hosts appsolworld

Comments

Popular posts from this blog

How to drop index and before dropping it how to get the DDL.

PRVG-11250 : The check "RPM Package Manager database" was not performed because

How to troubleshoot Long Running Concurrent Request in EBS 12.2

ORA-00257:archiver error, connect internal only until freed

Verifying Daemon “Avahi-Daemon” Not Configured And Running …FAILED (PRVG-1360)

Linux OL7/RHEL7: PRVE-0421 : No entry exists in /etc/fstab for mounting /dev/shm

CPU Patch Analysis

How to write to a CSV file using Oracle SQL*Plus

SKIP DNS RESLOV.CONF CHECK DURING RAC CONFIGURATION

How to fix Oracle SQL Developer connection issue "Got minus one from a read call"