Go to main content

Working With Oracle® Solaris 11.4 Directory and Naming Services: LDAP

Exit Print View

Updated: November 2020

Displaying the LDAP Naming Service Information

You can use the ldaplist utility to display information about LDAP naming service. This LDAP utility lists the naming information from the LDAP servers in LDIF format, which can be useful for troubleshooting. For more information, see the ldaplist(1) man page.

Displaying All LDAP Containers

The ldaplist command displays its output with a blank line separating records, which is helpful for big multiline records.

The output of ldaplist depends upon the client configuration. For example, if the value of ns_ldap_search is sub rather than one, ldaplist lists all the entries under the current search baseDN.

The following example shows sample ldaplist output.

# ldaplist
dn: ou=people,dc=west,dc=example,dc=com

dn: ou=group,dc=west,dc=example,dc=com

dn: ou=rpc,dc=west,dc=example,dc=com

dn: ou=protocols,dc=west,dc=example,dc=com

dn: ou=networks,dc=west,dc=example,dc=com

dn: ou=netgroup,dc=west,dc=example,dc=com

dn: ou=aliases,dc=west,dc=example,dc=com

dn: ou=hosts,dc=west,dc=example,dc=com

dn: ou=services,dc=west,dc=example,dc=com

dn: ou=ethers,dc=west,dc=example,dc=com

dn: ou=profile,dc=west,dc=example,dc=com

dn: automountmap=auto_home,dc=west,dc=example,dc=com

dn: automountmap=auto_direct,dc=west,dc=example,dc=com

dn: automountmap=auto_master,dc=west,dc=example,dc=com

dn: automountmap=auto_shared,dc=west,dc=example,dc=com

Displaying All User Entry Attributes

To list specific information such as a user's passwd entry, use the getent command. For example:

# getent passwd user1
user1::30641:10:Joe Q. User:/home/user1:/bin/csh

You also use the getent command to perform lookups on databases that are listed in the automount table, for example, getent automount/map [key]. In the following example, auto_home is the name of the automount map and user1 is the search key. If you do not specify any search key, then the entire content of the specified automount map is listed.

# getent automount/auto_home user1
user1 server-name:/home/user1

To list all attributes, use ldaplist with the -l option.

# ldaplist -l passwd user1
dn: uid=user1,ou=People,dc=west,dc=example,dc=com
uid: user1
cn: user1
uidNumber: 30641
gidNumber: 10
gecos: Joe Q. User
homeDirectory: /home/user1
loginShell: /bin/csh
objectClass: top
objectClass: shadowAccount
objectClass: account
objectClass: posixAccount
shadowLastChange: 6445