{"id":11,"date":"2013-08-27T06:51:28","date_gmt":"2013-08-27T06:51:28","guid":{"rendered":"http:\/\/muse.oneshot.in\/?p=11"},"modified":"2013-08-27T06:54:40","modified_gmt":"2013-08-27T06:54:40","slug":"nsswitch-conf5-linux-man-page","status":"publish","type":"post","link":"https:\/\/muse.oneshot.in\/?p=11","title":{"rendered":"nsswitch.conf(5) &#8211; Linux man page"},"content":{"rendered":"<p><b><a href=\"http:\/\/muse.oneshot.in\/wp-content\/uploads\/2013\/08\/images.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14\" alt=\"images\" src=\"http:\/\/muse.oneshot.in\/wp-content\/uploads\/2013\/08\/images.jpg\" width=\"229\" height=\"220\" \/><\/a><\/b><\/p>\n<p><b>Name<\/b><\/p>\n<p>nsswitch.conf &#8211; Name Service Switch configuration file<\/p>\n<p><b>Description<\/b><\/p>\n<p>The Name Service Switch (NSS) configuration file, <i>\/etc\/nsswitch.conf<\/i>, is used by the GNU C Library to determine the sources from which to obtain name-service information in a range of categories, and in what order. Each category of information is identified by a database name.<\/p>\n<p>The file is plain ASCII text, with columns separated by spaces or tab characters. The first column specifies the database name. The remaining columns describe the order of sources to query and a limited set of actions that can be performed by lookup result.<\/p>\n<p>The following databases are understood by the GNU C Library:<\/p>\n<p><b>aliases <\/b><\/p>\n<p>Mail aliases, used by getaliasent(3) and related functions.<\/p>\n<p><b>ethers <\/b><\/p>\n<p>Ethernet numbers.<\/p>\n<p><b>group <\/b><\/p>\n<p>Groups of users, used by getgrent(3) and related functions.<\/p>\n<p><b>hosts <\/b><\/p>\n<p>Host names and numbers, used by gethostbyname(3) and related functions.<\/p>\n<p><b>initgroups <\/b><\/p>\n<p>Supplementary group access list, used by getgrouplist(3) function.<\/p>\n<p><b>netgroup <\/b><\/p>\n<p>Network-wide list of hosts and users, used for access rules. C libraries before glibc 2.1 supported netgroups only over NIS.<\/p>\n<p><b>networks <\/b><\/p>\n<p>Network names and numbers, used by getnetent(3) and related functions.<\/p>\n<p><b>passwd <\/b><\/p>\n<p>User passwords, used by getpwent(3) and related functions.<\/p>\n<p><b>protocols <\/b><\/p>\n<p>Network protocols, used by getprotoent(3) and related functions.<\/p>\n<p><b>publickey <\/b><\/p>\n<p>Public and secret keys for Secure_RPC used by NFS and NIS+.<\/p>\n<p><b>rpc <\/b><\/p>\n<p>Remote procedure call names and numbers, used by getrpcbyname(3) and related functions.<\/p>\n<p><b>services <\/b><\/p>\n<p>Network services, used by getservent(3) and related functions.<\/p>\n<p><b>shadow <\/b><\/p>\n<p>Shadow user passwords, used by getspnam(3) and related functions.<\/p>\n<p>Here is an example \/etc\/nsswitch.conf file:<\/p>\n<p>passwd:<\/p>\n<p>compat<\/p>\n<p>group:<\/p>\n<p>compat<\/p>\n<p>shadow:<\/p>\n<p>compat<\/p>\n<p>hosts:<\/p>\n<p>dns [!UNAVAIL=return] files<\/p>\n<p>networks:<\/p>\n<p>nis [NOTFOUND=return] files<\/p>\n<p>ethers:<\/p>\n<p>nis [NOTFOUND=return] files<\/p>\n<p>protocols:<\/p>\n<p>nis [NOTFOUND=return] files<\/p>\n<p>rpc:<\/p>\n<p>nis [NOTFOUND=return] files<\/p>\n<p>services:<\/p>\n<p>nis [NOTFOUND=return] files The first column is the database name. The remaining columns specify:<\/p>\n<p>*<\/p>\n<p>One or more service specifications e.g., &#8220;files&#8221;, &#8220;db&#8221;, or &#8220;nis&#8221;. The order of the services on the line determines the order in which those services will be queried, in turn, until a result is found.<\/p>\n<p>*<\/p>\n<p>Optional actions to perform if a particular result is obtained from the preceding service, e.g., &#8220;[NOTFOUND=return]&#8221;.<\/p>\n<p>The service specifications supported on your system depend on the presence of shared libraries, and are therefore extensible. Libraries called <i>\/lib\/libnss_SERVICE.so.<\/i><b>X<\/b> will provide the named <i>SERVICE<\/i>. On a standard installation, you can use &#8220;files&#8221;, &#8220;db&#8221;, &#8220;nis&#8221;, and &#8220;nisplus&#8221;. For the <b>hosts<\/b> database, you can additionally specify &#8220;dns&#8221;. For the <b>passwd<\/b>, <b>group<\/b>, and <b>shadow<\/b> databases, you can additionally specify &#8220;compat&#8221; (see <b>Compatibility mode<\/b> below). The version number <b>X<\/b> may be 1 for glibc 2.0, or 2 for glibc 2.1 and later. On systems with additional libraries installed, you may have access to further services such as &#8220;hesiod&#8221;, &#8220;ldap&#8221;, &#8220;winbind&#8221; and &#8220;wins&#8221;.<\/p>\n<p>An action may also be specified following a service specification. The action modifies the behavior following a result obtained from the preceding data source. Action items take the general form:<\/p>\n<p>[<i>STATUS<\/i>=<i>ACTION<\/i>]<br \/>\n[!<i>STATUS<\/i>=<i>ACTION<\/i>]<\/p>\n<p>where<\/p>\n<p><i>STATUS<\/i> =&gt; <b>success<\/b> | <b>notfound<\/b> | <b>unavail<\/b> | <b>tryagain<\/b><i><br \/>\nACTION<\/i> =&gt; <b>return<\/b> | <b>continue<\/b><\/p>\n<p>The ! negates the test, matching all possible results except the one specified. The case of the keywords is not significant.<\/p>\n<p>The <i>STATUS<\/i> value is matched against the result of the lookup function called by the preceding service specification, and can be one of:<\/p>\n<p><b>success<\/b><\/p>\n<p>No error occurred and the requested entry is returned. The default action for this condition is &#8220;return&#8221;.<\/p>\n<p><b>notfound<\/b><\/p>\n<p>The lookup succeeded, but the requested entry was not found. The default action for this condition is &#8220;continue&#8221;.<\/p>\n<p><b>unavail<\/b><\/p>\n<p>The service is permanently unavailable. This can mean either that the required file cannot be read, or, for network services, that the server is not available or does not allow queries. The default action for this condition is &#8220;continue&#8221;.<\/p>\n<p><b>tryagain<\/b><\/p>\n<p>The service is temporarily unavailable. This could mean a file is locked or a server currently cannot accept more connections. The default action for this condition is &#8220;continue&#8221;.<\/p>\n<p>The <i>ACTION<\/i> value can be one of:<\/p>\n<p><b>return<\/b><\/p>\n<p>Return a result now. Do not call any further lookup functions. However, for compatibility reasons, if this is the selected action for the <b>group<\/b> database and the <b>notfound<\/b> status, and the configuration file does not contain the <b>initgroups<\/b> line, the next lookup function is always called, without affecting the search result.<\/p>\n<p><b>continue<\/b><\/p>\n<p>Call the next lookup function.<\/p>\n<p><b>Compatibility mode (compat)<\/b><\/p>\n<p>The NSS &#8220;compat&#8221; service is similar to &#8220;files&#8221; except that it additionally permits special entries in <i>\/etc\/passwd<\/i> for granting users or members of netgroups access to the system. The following entries are valid in this mode:<\/p>\n<p><b>+<\/b><i>user<\/i><\/p>\n<p>Include the specified <i>user<\/i> from the NIS passwd map.<\/p>\n<p><b>+@<\/b><i>netgroup<\/i><\/p>\n<p>Include all users in the given <i>netgroup<\/i>.<\/p>\n<p><b>&#8211;<\/b><i>user<\/i><\/p>\n<p>Exclude the specified <i>user<\/i> from the NIS passwd map.<\/p>\n<p><b>-@<\/b><i>netgroup<\/i><\/p>\n<p>Exclude all users in the given <i>netgroup<\/i>.<\/p>\n<p><b>+<\/b><\/p>\n<p>Include every user, except previously excluded ones, from the NIS passwd map.<\/p>\n<p>By default the source is &#8220;nis&#8221;, but this may be overridden by specifying &#8220;nisplus&#8221; as the source for the pseudo-databases <b>passwd_compat<\/b>, <b>group_compat<\/b>, and <b>shadow_compat<\/b>.<\/p>\n<p><b>Files<\/b><\/p>\n<p>A service named <i>SERVICE<\/i> is implemented by a shared object library named <i>libnss_SERVICE.so.<\/i><b>X<\/b> that resides in <i>\/lib<\/i>.<\/p>\n<p><i>\/etc\/nsswitch.conf<\/i><\/p>\n<p>NSS configuration file.<\/p>\n<p><i>\/lib\/libnss_compat.so.<\/i><\/p>\n<p><b>X<\/b> implements &#8220;compat&#8221; source.<\/p>\n<p><i>\/lib\/libnss_db.so.<\/i><b>X<\/b> implements &#8220;db&#8221; source.<\/p>\n<p><i>\/lib\/libnss_dns.so.<\/i><b>X<\/b> implements &#8220;dns&#8221; source.<\/p>\n<p><i>\/lib\/libnss_files.so.<\/i><b>X<\/b> implements &#8220;files&#8221; source.<\/p>\n<p><i>\/lib\/libnss_hesiod.so.<\/i><\/p>\n<p><b>X<\/b> implements &#8220;hesiod&#8221; source.<\/p>\n<p><i>\/lib\/libnss_nis.so.<\/i><b>X<\/b> implements &#8220;nis&#8221; source.<\/p>\n<p><i>\/lib\/libnss_nisplus.so.<\/i><b>X<\/b><\/p>\n<p>implements &#8220;nisplus&#8221; source.<\/p>\n<p><b>Notes<\/b><\/p>\n<p>Within each process that uses <b>nsswitch.conf<\/b>, the entire file is read only once. If the file is later changed, the process will continue using the old configuration.<\/p>\n<p>Traditionally, there was only a single source for service information, often in the form of a single configuration file (e.g., <i>\/etc\/passwd<\/i>). However, as other name services, such as the Network Information Service (NIS) and the Domain Name Service (DNS), became popular, a method was needed that would be more flexible than fixed search orders coded into the C library. The Name Service Switch mechanism, which was based on the mechanism used by Sun Microsystems in the Solaris 2 C library, introduced a cleaner solution to the problem.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Name nsswitch.conf &#8211; Name Service Switch configuration file Description The Name Service Switch (NSS) configuration file, \/etc\/nsswitch.conf, is used by the GNU C Library to determine the sources from which to obtain name-service information in a range of categories, and in what order. Each category of information is identified by a database name. The file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-redhat"],"_links":{"self":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":5,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}