Name Service Switch
From Wikipedia, the free encyclopedia
In Unix-like operating systems, the Name Service Switch (NSS) allows replacement of many Unix configuration files (for example: /etc/passwd, /etc/group, /etc/hosts) with one or more centralized databases; it also offers configurable mechanisms for accessing those databases. (Earlier Unix-like systems, with the notable exception of Ultrix, either accessed only the configuration files or had hard-coded rules for which files or databases to access; Ultrix offered nearly identical functionality to the Name Service Switch, using the configuration file /etc/svc.conf.)
Sun Microsystems first developed NSS for their Solaris operating system, but subsequently programmers ported it to many other operating systems including FreeBSD, NetBSD, Linux, HP-UX, IRIX and AIX.
Contents |
[edit] nsswitch.conf
A system administrator usually configures NSS using the file /etc/nsswitch.conf. This lists databases (such as group, passwd) and one or more sources for obtaining that information (e.g files for local files, nis for the Network Information Service, nisplus for NIS+, ldap for the Lightweight Directory Access Protocol, or mysql for the MySQL database service). For example:
passwd: files nis group: files nis hosts: files dns
The order of the services listed determines in which order NSS will attempt to use those service to resolve queries on the specified database.
[edit] NSS and the C library
NSS is implemented within the C library, so that calls to functions such as getpwent or getgrent will call into the appropriate NSS module. Making the modifications at the library level means that existing applications that use these routines for identity information do not require any changes to work with NSS.
[edit] See also
[edit] External links
- NetBSD File Formats Manual : name-service switch configuration file –
- Name Service Switch implementation in the GNU C Library
- NSS module supporting LDAP: nss_ldap
- Another NSS module supporting LDAP: nss-ldapd
- NSS module supporting AFS: nss_afs