How to install and configure NIS Server on Debian 10

NIS is a network information service that is widely used to exchange configuration data about various systems throughout the network. In today’s article, we will talk about the methods of installing and configuring this server on a Debian 10 system.

Method to install NIS server in Debian 10:

To install a NIS server on a Debian 10 machine, you need to follow three main steps:

Step # 1: Upgrade your Debian 10 system:

First, you need to update your system with the following command:

sudo apt-get update

After successfully updating your system, you will receive messages.

Step # 2: Install NIS server on your Debian 10 system:

We can now install the NIS server using the following command:

sudo apt-get –y install nis

Step # 3: Configure a domain name for your Debian 10 NIS server:

During the installation of the NIS server, you will be asked to provide a domain name for it. You can use any name of your choice, or choose the default name and press Enter.

After setting up a domain name for your NIS server, you will notice that the installation is complete within a few seconds, and messages are displayed on the terminal.

Method for setting up NIS server in Debian 10:

After installing the NIS server on Debian 10, we can continue to configure it as follows:

Step # 1: Start the “rpcbind” service on Debian 10:

First, we need to start the “rpcbind” service in Debian 10 using the command shown below:

sudo systemctl start rpcbind

Step # 2: Check the status of the “rpcbind” service in Debian 10:

Now we will check if the “rpcbind” service has started successfully by running the following command:

sudo systemctl status rpcbind

You can easily see the status of the “rpcbind” service on our Debian 10 system.

Step # 3: Start the “ypserv” service in Debian 10:

We will then start the “ypserv” service in Debian 10 with the following command:

sudo systemctl start ypserv

Step # 4: Check the status of the “ypserv” service in Debian 10:

Now we will check if the ypserv service was started successfully or not by running the command shown below:

sudo systemctl status ypserv

You can easily see the status of the “ypserv” service on our Debian 10 system.

Step # 5: Set up NIS as the master server on Debian 10:

We will now install NIS as the master server on Debian 10. To do this, we will access the / etc / default / nis file using the command shown below:

sudo nano /etc/default/nis

Then we assign the value “master” to the variable “NISSERVER”. After that we can save and close our file.

Step # 6: Configure a valid range of IP addresses in Debian 10:

We will now configure a range of IP addresses to allow access to our NIS server. To do this, we access the /etc/ypserv.securenets file with the following command:

sudo nano /etc/ypserv.securenets

Now let’s comment out the line.

Finally, we will add a valid IP range to the end of this file as shown in the image below. After that we can save and close our file.

Step # 7: Add the IP address for your NIS server in Debian 10:

Now we can add any desired IP address for our NIS server. To do this, we need to access the / etc / hosts file using the command shown below:

sudo nano /etc/hosts

We need to find the name of our NIS server in this file and then assign any IP address we want, or even choose the default one. After that, we can save and close this file.

Step # 8: restart the NIS server on Debian 10:

After completing all these settings, we will restart the NIS server with the following command:

sudo systemctl restart nis

Step # 9: Upgrade the NIS database in Debian 10:

Finally, we will update the NIS database using the command shown below:

sudo /usr/lib/yp/ypinit –m

At this point, we can add any hosts to this database that will host the NIS servers. After you’ve added the hostnames, you can press Ctrl + D.

After that, you need to enter “y” and then press the Enter key.

After updating the NIS database, you will receive a confirmation message that the selected system has been configured as a master NIS server.

Method to remove NIS server from Debian 10:

We can also remove the NIS server from our Debian 10 system at any time by following these two steps:

Step # 1: Remove the NIS server along with its configuration files:

First, we’ll run the command shown below to remove the NIS server and its configuration files:

sudo apt-get purge nis

Step # 2: Remove all additional packages and dependencies:

Finally, we will also remove all unused packages and dependencies with the following command:

sudo apt-get autoremove

Conclusion:

This article was about the methods for installing and configuring an NIS server on Debian 10. These methods may seem overwhelming, but it only took us a few minutes to complete these settings. Finally, we ended this article with a description of how to remove NIS from Debian 10.

Sidebar