Debian 10 Buster
Sponsored Link

NIS : Configure NIS Server2019/07/29

Configure NIS Server in order to share users' accounts in your local networks.
[1] Install NIS System.
apt -y install nis
Preconfiguring packages ...
# input your domain name

# Autostart NIS during installation will be fail because configuration is none yet, so wait for a moment to finish it.

 +----------------------------| Configuring nis |----------------------------+
 | Please choose the NIS "domainname" for this system. If you want this      |
 | machine to just be a client, you should enter the name of the NIS domain  |
 | you wish to join.                                                         |
 |                                                                           |
 | Alternatively, if this machine is to be a NIS server, you can either      |
 | enter a new NIS "domainname" or the name of an existing NIS domain.       |
 |                                                                           |
 | NIS domain:                                                               |
 |                                                                           |
 | srv.world_____________________________________________________________    |
 |                                                                           |
 |                                  <Ok>                                     |
 |                                                                           |
[2] Configure as a NIS master Server.
vi /etc/default/nis
# line 6: change (set NIS master server)

vi /etc/ypserv.securenets
# This line gives access to everybody. PLEASE ADJUST!
# comment out

# add to the end: IP range you allow to access

vi /etc/hosts       localhost
# add own IP address for NIS        dlp

systemctl restart nis
# update NIS database

/usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers. is in the list of NIS server hosts.  Please continue to add
the names for the other hosts, one per line.  When you are done with the
list, type a <control D>.
        next host to add:
        next host to add:  # Ctrl + D key
The current list of NIS servers looks like this:

Is this correct?  [y/n: y]  y
We need a few minutes to build the databases...
Building /var/yp/
Running /var/yp/Makefile...
make[1]: Entering directory '/var/yp/'
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating rpc.byname...
Updating rpc.bynumber...
Updating services.byname...
Updating services.byservicename...
Updating netid.byname...
Updating protocols.bynumber...
Updating protocols.byname...
Updating netgroup...
Updating netgroup.byhost...
Updating netgroup.byuser...
Updating shadow.byname...
make[1]: Leaving directory '/var/yp/' has been set up as a NIS master server.

Now you can run ypinit -s on all slave server.
[3] If you added users in local server, apply them to NIS database, too.
cd /var/yp

Matched Content