Complete NIS server in 5 minutes

Source: Internet
Author: User

The YP (Yellow Pages) protocol is an RPC (Remote process call) application service that provides directory services. With this, you can share a centralized password file on the network, which greatly simplifies the maintenance of accounts and passwords by client users. The yp-tools/ypbind and ypserv software packages are used to install the NIS server. you can install the NIS Server when installing linux.

Configure the NIS Server

Two packages, ypserv and yptools, are required for the NIS server. Now that the system has them, you can configure the NIS server.

Before configuring the server software, you must determine whether to create some slave servers. If you want to create them, you need to know their host names. The concept of master-slave server is similar to that of DNS. In addition to determining the name of the NIS server, you also need to determine an NIS domain name. This domain name is not a DNS domain name. This domain name must be in the/etc/hosts file.

To configure the master NIS server, refer to the relevant documentation)

First, you need to set the domain name by running the domainname command.

# Domainname ll

Modify the startup configuration script/etc/sysconfig/network

Add NIS_DOMAIN = ll

Edit the/var/yp/Makefile file to keep it unchanged. You can enable the default shadow file.

Initialize the NIS Database

#/Usr/lib/yp/ypinit-m

Type CTRL + D. (Prompt to enter the slave server) at this time, the system will generate a ll subdirectory under the/var/yp/directory. It contains many image files. Passwd. byname, passwd. byuid, group. byname, group. bygid, etc)

Then run the service program:

#/Etc/rc. d/init. d/ypserv start

#/Etc/rc. d/init. d/yppasswdd start

Configure the NIS client

The ypbind software package is required. Make sure the system has this software package.

First, edit the/etc/yp. conf file.

Add: domain ll

Ypserver ll then adds the IP address of ll to the/etc/hosts file.

Modify the/etc/sysconfig/network file,

Add NISDOMAIN = ll

Finally, modify the/etc/nsswitch. conf file,

Compat/hesiod relationship,

In addition, when the security settings are enabled, the client ip address that allows the access server is located in the front and the last line is *** deny. In the order of File Reading, files indicates a local file, nisplus indicates nis +, nis indicates the nis server, and dns indicates the dns server.

Finally, start the NIS client program:

#/Etc/rc. d/init. d/ypbind start

You can test whether it is successful.

#/Ypcat passwd

If it displays part of the passwd file of the NIS server as a common user), the request is successful. You can use these users to log on to your client.

Passwd Screen

Whether it is an NIS server or an NIS client, if you want to automatically execute the service when the machine starts, you can set it in the setup program.

Solve the problem

If the NIS software is not working properly, check the following items:

Confirm that the process is in progress. Run the ps auxw command to list all running processes and confirm that they are running.

Check the system log/var/log) file to check whether there is a message indicating the peripherals that affect the configuration.

If the process looks running but does not respond, kill them and restart them. In some cases, the daemon does not work properly and needs to be restarted.

Make sure that the/etc/nsswitch. conf configuration file is correct. Usually the problem occurs here.

If you try to manually start the daemon, make sure to log on as root.

On Fedora,

1. First check rpm-qa | grep ypbind to ensure that ypbind has been installed;

2. Run chkconfig ypbind on, and then run ntsysv to ensure that ypbind is selected;

3. in/etc/yp. conf, add the first option of all rows to nis.

4. Restart fedora. The NIS account logon takes effect.

  1. NIS Server troubleshooting
  2. Tips of NIS for making network management simple
  3. Use NIS and NFS to manage UNIX Networks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.