Ubuntu 20.04
Sponsored Link

NIS : Configure Server2020/09/16

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 primary Server.
vi /etc/default/nis
# line 6: change (set NIS primary 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.srv.world dlp

systemctl restart rpcbind 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.  dlp.srv.world 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:  dlp.srv.world
        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/srv.world/ypservers...
Running /var/yp/Makefile...
make[1]: Entering directory '/var/yp/srv.world'
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... Ignored -> merged with passwd
make[1]: Leaving directory '/var/yp/srv.world'

dlp.srv.world has been set up as a NIS master server.

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

Matched Content