getent [option]… database key …
Displays entries from databases supported by the Name Service Switch libraries, which are configured in
/etc/nsswitch.conf.
If no key is provided, all entries will be displayed (unless the database does not support enumeration).
Entries for keys that match are displayed.
The database may be any of those supported by the GNU C Library
ahosts |
at RWS > cat /etc/nsswitch.conf # /etc/nsswitch.conf # # An example Name Service Switch config file. # This file should be sorted with the most-used services at the beginning. # # The entry '[NOTFOUND=return]' means that the search for an # entry should stop if the search in the previous entry turned up nothing. # if the search failed due to some other reason # (like no NIS server responding) then the search continues with the # next entry. # # Valid entries include: # # nisplus NIS+ (NIS version 3) # nis NIS (NIS version 2), also called YP # dns DNS (Domain Name Service) # files the local files # db the local database (.db) files # compat NIS on compat mode # hesiod Hesiod for user lookups # [NOTFOUND=return] Stop searching if not found # # To use db, put the "db" in front of "files" for entries to be # looked up first in the databases # # Example: #passwd: db files nisplus nis #shadow: db files nisplus nis #group: db files nisplus nis passwd: files mysql sss shadow: files mysql sss group: files mysql sss #hosts: db files nisplus nis dns hosts: files dns # Example - obey only what nisplus tells us... #services: nisplus [NOTFOUND=return] files #networks: nisplus [NOTFOUND=return] files #protocols: nisplus [NOTFOUND=return] files #rpc: nisplus [NOTFOUND=return] files #ethers: nisplus [NOTFOUND=return] files #netmasks: nisplus [NOTFOUND=return] files bootparams: nisplus [NOTFOUND=return] files ethers: files netmasks: files networks: files protocols: files rpc: files services: db files sss netgroup: db files sss publickey: nisplus automount: db files sss aliases: files nisplus sudoers: files sss
dapi2: > cat /etc/nsswitch.conf # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: files group: files shadow: files gshadow: files hosts: files mdns4_minimal [NOTFOUND=return] dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis
-s service |
| 0 | success |
| 1 | Missing arguments, or database unknown. |
| 2 | key could not be found |
| 3 | Enumeration not supported on this database. |
nsswitch.conf(5)