Ubuntu 11.04
Sponsored Link

Configure NIS Server2011/04/30

  Configure NIS server in order to share users' accounts in local network.

[1] Install NIS system
root@drv:~#
aptitude -y install nis portmap


Preconfiguring packages ...

# input domain name

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


[2] Configure NIS Server
root@drv:~#
vi /etc/default/nis


# line 6: change (set NIS master server)

NISSERVER=
master


root@drv:~#
vi /etc/ypserv.securenets


# This line gives access to everybody. PLEASE ADJUST!
# make it comment

#
0.0.0.0 0.0.0.0

# add at the last: IP address you allow

255.255.255.0
10.0.0.0


root@drv:~#
vi /var/yp/Makefile


# line 119: add

ALL = passwd
shadow
group hosts rpc services netid protocols netgrp

root@drv:~#
vi /etc/hosts


127.0.0.1
localhost

127.0.1.1
dlp.srv.world   dlp

# add own IP address for NIS database

10.0.0.39
drv.srv.world   drv


root@drv:~#
/usr/lib/yp/ypinit -m
# update NIS database


At this point, we have to construct a list of the hosts which will run NIS
servers. master 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: drv.srv.world
    next host to add:
# push Ctrl+D

The current list of NIS servers looks like this:

drv.srv.world

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 shadow.byname...
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...
make[1]: Leaving directory `/var/yp/srv.world'

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

Now you can run ypinit -s drv.srv.world on all slave server.

root@drv:~#
/etc/init.d/nis start

* Starting NIS services
  ...done.

# It's neccessary to update NIS database with following way if new user is added again

root@drv:~#
cd /var/yp

root@drv:/var/yp#
Matched Content