How to setup a NIS Slave server on Debian Squeeze


I am assuming that we have two networks linked with a vpn connection (net1: and net2: Also I am assuming that on net1 is a functional NIS master server.


How to setup a NIS client

If you put a servername in /etc/yp.conf, make sure the server is also in /etc/hosts. Otherwise if your system boots and the network is not yet up or DNS isn't reachable, ypserv cannot resolve the servers in /etc/yp.conf and will hang!

vim /etc/hosts    nis1

Install the netbase, portmap and nis packages

apt-get install nis

Configure NIS servers

vim /etc/yp.conf

domain test-auth server

Make domain binding persistent

vim /etc/defaultdomain


Setup 'running' domain

nisdomainname test-auth

Update local maps search rules

vim /etc/nsswitch.conf

passwd:         db files compat nis
group:          db files compat nis
shadow:         db files compat nis
netgroup:       nis

Restart NIS services

/etc/init.d/nis stop
/etc/init.d/nis start

Make the auth process query NIS

vim /etc/passwd


vim /etc/group


Test NIS client setup

id user

Setup a NIS server slave

vim /etc/default/nis

Restart NIS server

/etc/init.d/nis stop
/etc/init.d/nis start


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.