getent.ldap(1)
β¨ getent.ldap β the manual page, bestie edition β¨
okay so welcome to getent.ldap(1), the user command that's about to be your new fav π this is a section 1 manual page and it's literally all about pulling info out of LDAP. buckle up π
πΈ NAME πΈ
getent.ldap β query information from LDAP
π¦ SYNOPSIS π¦
getent.ldap [options] [DATABASE] [KEY...]
π DESCRIPTION π
So getent.ldap is the girl who looks up or enumerates information from LDAP. and here's the thing that makes her different from getent(1) β she completely bypasses all the lookups you configured in /etc/nsswitch.conf and goes straight to the nslcd(8) daemon. no middleman, no nsswitch, just vibes and direct queries β¨
She does try her best to match the behaviour and output of getent and the format of the corresponding flat files, but ngl there are a number of differences. If multiple entries are found in LDAP that match a specific query, multiple values are printed (like ethernet addresses that have multiple names, services that support multiple protocols, etc.). Also some databases have extra options, which we get into below π
π OPTIONS π
The options that may be specified to the getent.ldap command are:
-h,--helpβ display short help and exit. short and sweet, love that for her π«Ά-V,--versionβ output version information and exit.
π DATABASES π
The DATABASE argument may be any of the supported databases below:
aliasesβ lists or queries email aliases. IfKEYis given it searches for the alias by name, otherwise it returns all aliases from LDAP.ethersβ lists or queries ethernet addresses. IfKEYmatches the format of an ethernet address a search by address is performed, otherwise a search by name is performed, or all entries are returned ifKEYis omitted. Unlikegetent,getent.ldapddoes support enumerating all ethernet addresses πgroupβ lists or queries groups. IfKEYis numeric, it searches for the group by group id.group.bymemberβ theKEYis a user name and groups are returned for which this user is a member. The format is similar to thegroupoutput but the group members are left out for performance reasons. efficient queen β‘hostsβ list or search host names and addresses by either host name, IPv4 or IPv6 address. This returns both IPv4 and IPv6 addresses (if available). both?? she said yes to both πhostsv4β similar tohostsbut any supplied IPv6 addresses are treated as host names and only IPv4 addresses are returned.hostsv6β similar tohostsbutKEYis treated as an IPv6 address or a host name and only IPv6 addresses are returned.netgroupβ list or query netgroups and netgroup triples (host, user, domain) that are a member of the netgroup. Unlikegetent,getent.ldapddoes support enumerating all ethernet addresses.netgroup.norecβ similar tonetgroupexcept that no subsequent lookups are done to expand netgroups which are member of the supplied netgroup, and the output may contain both other netgroup names and netgroup triples. no recursion, no drama πnetworksβ list or query network names and addresses.KEYmay be a network name or address. This map can return both IPv4 and IPv6 network addresses.networksv4β only return IPv4 network addresses.networksv6β only return IPv6 network addresses.passwdβ enumerate or search the user account database.KEYmay be a user name or numeric user id, or be omitted to list all users.protocolsβ enumerate the internet protocols database.rpcβ list or search user readable names that map to RPC program numbers. Searching byKEYcan be done on name or rpc program number.servicesβ list or search the mapping between names for internet services and their corresponding port numbers and protocol types. TheKEYcan be either a service name or number, followed by an optional slash and protocol name to restrict the search to only entries for the specified protocol.shadowβ enumerate or search extended user account information. > note that shadow information is likely only exposed to therootuser and by defaultnslcddoes not expose password hashes, even toroot. π like, even root doesn't get the hashes by default, that's the whole point bestie.
π§ SEE ALSO π§
getent(1), nslcd(8) β go read those too, iykyk π
π AUTHOR π
This manual was written by Arthur de Jong <arthur@arthurdejong.org>. iconic behaviour, thank you for your service π«‘
π BUGS π
Currently, getent.ldapd does not correctly set an exit code. It should return the same kind of exit codes as getent does (e.g. for missing entries). so like, the exit code situation is a little unhinged rn, noted and flagged π
and that's the whole page babes β¨ this was Version 0.9.13, from Feb 2025 β getent.ldap(1), out. slay, periodt, go query some LDAP π
π
π¦ where this page comes from
- arch rolling: nss-pam-ldapd 0.9.13-1 Β· LGPL2.1
- debian trixie: nslcd-utils 0.9.13-1
- nixos 26.05: nss-pam-ldapd 0.9.13
- nixpkgs unstable: nss-pam-ldapd 0.9.13
- ubuntu questing: nslcd-utils 0.9.13-1
- ubuntu questing: nslcd-utils 0.9.13-1ubuntu0.1
- ubuntu resolute: nslcd-utils 0.9.13-2ubuntu2
- ubuntu stonking: nslcd-utils 0.9.13-2ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms