Article Title: configure the NIS service in linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
NIS Server Configuration]
Step 1: Install related software install the ypserv-2.19-3 and portmap-4.0-65.2.2.1 in the third disc, install the yp-tools-2.9.0.1 and ypbind-1.19-7.e15 In the second disc. Ypserv is the server program of NIS, yp-tools and ypbind are client programs, and portmap is the port allocation program. Generally, you only need to install ypserv and portmap on the NIS server. However, because the server itself is also its own client, we can install these four software packages on the server. Command: # rpm-ivh/mnt/cdrom/Servers/ypserv-2.19-3
# Rps-ivh/mnt/cdrom/Servers/portmap-4.0-65.2.2.1
# Rps-ivh/mnt/cdrom/Servers/yp-tools-2.9.0.1
# Rpm-ivh/mnt/cdrom/Servers/ypbind-1.19-7.e15 Step 2: configure Server Side ① set the NIS domain name to dne.com, run the following command:
# Nisdomainname dne.com
To automatically execute this operation after the system starts, you can add this command to the file/etc/rc. local. Command: echo "/bin/nisdomainname dne.com">/etc/rc. local ② configure the master configuration file/etc/ypserv on the server. conf: add control parameters at the end of the file to allow some clients to access the nis server. 127.0.0.0/255.255.255.0: *: none
192.168.20.0/255.255.255.0: *: none
All: *: deny
Keep the default value for other parameters! ③ Run the command to initialize the NIS Database:/usr/lib/yp/ypinit-m, set the name of the primary database storage host, press CTRL + D, and then press Y to confirm, at last, the program will create the initialized NIS database. After the database is created, corresponding file record settings will be available in the directory/var/yp. ④ Start the service. The related services on the server end include portmap, ypserv, and yppasswdd. The command is as follows: #/etc/init. d/portmap start
#/Etc/init. d/ypserv start
#/Etc/init. d/yppasswdd start
NIS client Configuration]
Step 1: Install the NIS client program and install the client packages portmap, ypbind, and yp-tools of NIS.
# Rps-ivh/mnt/cdrom/Servers/portmap-4.0-65.2.2.1
# Rps-ivh/mnt/cdrom/Servers/yp-tools-2.9.0.1
# Rpm-ivh/mnt/cdrom/Servers/ypbind-1.19-7.e15 Step 2: Set the NIS domain name to dne.com, run the following command: # nisdomainname dne.com Step 3: Set the NIS domain where the NIC is located, run the following command: # echo "NISDOMAIN = dne.com">/etc/sysconfig/network Step 4: configure the nis client configuration file to edit the file/etc/yp. conf, add the following parameter at the end of the file: domain dne.com server 192.168.20.200 Step 5: edit the file/etc/nsswitch. conf to change the password query sequence. Shadow files nis
Passwd files nis
Step 6 of group files nis: start the service portmap, ypbind #/etc/init. d/portmap start
#/Etc/init. d/ypbind start Step 7: test the nis client by running the following command: ypcat passwd. If you can output the account information of common users on the server, the NIS configuration is successful. Other test Commands include yptest and ypwhich-x.
[Extended function]
The predecessor of NIS was SUN's information sharing software called Yellow Page, which was later renamed as NIS due to registration subject matter. NIS can be used to centrally manage resources and share account information between LINUX systems. When the NIS client authenticates an account through the NIS server, the system time of the two is the same. Therefore, when configuring NIS, NTPD service is usually configured, that is, the Network Time Protocol, then, the cron is used to synchronize the clock at a scheduled time to achieve the same system time. In addition, NIS can also use NFS to roam user configuration files. We can use the/home directory on the NFS shared server, and then mount the/home directory to the client automatically when the NIS client system is started. The command is: mount-t nfs 192.168.0000200: /home
You can add this command to the file/etc/rc. local, you can also configure the file/etc/fstab to make the system mount automatically. When you log on to the nis client, it will automatically use its home directory on the server.