NIS is short for Network Information Services. It was initially developed by Sun Microsystems for UNIX? (Originally SunOS) centralized management of the system. At present, it has basically become the industry standard, all mainstream UNIX-like systems (Solaris, HP-UX, AIX, Linux, NetBSD, OpenBSD, FreeBSD and so on) Support NIS.
Sun was originally going to call NIS the Yellow Pages service, but Sun renamed it NIS due to trademark issues. The old terms (and yp) are still frequently seen and widely used. NIS is an RPC-based client/server system. Its functions are similar to the Active Directory in Windows. It allows a group of machines in an NIS domain to share a series of configuration files. In this way, the system administrator can configure the NIS client system that only contains the most basic configuration data, and add, delete, or modify configuration data on a single point.
In the NIS Environment, at least one NIS server is used to maintain the users, groups, and other information required by the client throughout the NIS environment, which is similar to the domain controller in the Windows Active Directory; multiple NIS clients use the NIS server for identity authentication.
The following describes how to use RHEL5 to set up the NIS Environment and configure the home directory for NIS users (This function allows users to roam configuration files similar to those in Windows activity Directories ). The following network topology will be used throughout the article:
1. Set up an NIS Server
1. NIS server packages: ypserv, ypbind (installed by default in RHEL5), and yp-tools (installed by default in RHEL5 ).
2. Create a user on the NIS server for use during client logon.
①: Create a directory for the NIS user's home directory.
②: When creating a user for NIS login, specify its home directory to a dedicated directory.
3. Specify the NIS domain name for the NIS server.
● Add the NIS domain to the/etc/sysconfig/network file, edit the file, and add the following lines at the bottom of the file: NISDOMAIN = test.com (here test.com is the NIS domain name, not the DNS region name of the server ).
● Run the nisdomainname test.com command.
● Add the following content to the/etc/rc. d/rc. local file.
4. Generate the NIS user database.
In the NIS environment, all users on the NIS Server are used for all client authentication in the NIS environment.
In step 2, the user has been created and the user's home directory has been specified. Run the following command to generate the NIS user database:
①: Generate the NIS user database.
②: NIS server host name. If there are multiple host names, enter them here.
③: Enter y.
6. Use NFS to share the NIS user's home directory.
Edit the/etc/exports file and add the following content (share the directories of all NIS users with NFS), and run the nfs restart command to start the NFS service: