name-service is a way to provide configuration information to Unix systems from different sources.
The most common example of the information provided is user account names for user IDs. For example, when a user runs ls, the files listed only have a UID number stored on the filesystem.
name service turns that number into a user name, by looking at the sources (such as a local passwd file, or ldap) configured in nsswitch.conf
Differences between name services and authentication
Name service is a separate task than authentication, which is handled by PAM on most Unix systems. The two are frequently confused with each other, as systems which provide user account information also store credentials used to authenticate.
Name service is primarily concerned with account data, whereas PAM handles authentication and authorization.
- Name service is used to look at the contents of a directory, using a file manager or command line tool. Authentication is not.
- Authentication is used to log in, name service is not.
- Unix systems connecting to Active Directory would use LDAP for name service, but Kerberos for authenticaton
- Unix systems with only local users only would use local files for both name-service and authentication, but may employ additional authentication controls such as smart card readers, or authorization controls such as time of day restrictions via PAM.