Tuesday, August 18, 2009

NIS Installation

1) Start services for server
ypserv
yppasswdd
ypbind
portmap

2) If setting up a client start ypbind.
To configure ypbind open /etc/yp.conf and add this line.

ypserver 192.168.0.1 (server ip)

3) To config server first edit /var/yp/securenets. It should be like this.

#Always allow localhost
255.0.0.0 127.0.0.0
#Our Lan
255.255.255.0 192.168.0.0
#For everyone put this
0.0.0.0 0.0.0.0

Now set NIS Domain with following command.

ypdomain name engineers (domain name)


Now run the command

/usr/lib/yp/ypinit -m

This creates all NIS database.Actually makedbm is the program that converts the ASCII to DBM. This is all for a server.

4) Now in client you will find programs like ypwhich, ypcat, yppasswd, yppoll, ypmatch. Normally in /usr/bin or sbin. First set domain name

/bin/ypdomain name engineers

Then start ypbind. Use rpcinfo -p to see if its running.

Now you will be able to use programs like

ypcat passwd

Note that /var/yp directoty must exist before ypbind is started.

You can edit /etc/passwd.

+ullas : : : : : : :
+elango : : : : : : :
+@samba : : : : : : :
+:*: : : : : :/etc.noshell
-ftp

This adds login access and elango and all members of samba group but show all a/c data due to 4th line. FTP users are disabled.

5) Now setup properly nsswitch.conf

hosts: files nis dns

To see to it that look into details in this order. Here is a eg: must use nisplus if version is above 3

passwd : compact
group : compact
shadow : compact # for lib5 use shadow : files nis
passwd_compact : nis
group_compact : nis
shadow_compact : nis
hosts : nis files dns
services : nis [NOTFOUND=return] files
networks : nis [NOTFOUND=return] files
protocols : nis [NOTFOUND=return] files
rpc : nis [NOTFOUND=return] files

No comments: