Tuesday, January 16, 2007

NIS and NFS services

(Please read this post first: http://michael-ambrus-tipps.blogspot.com/2006/11/nis.html)

This contains minimum information to set up NIS and NFS services.

NFS
1)
make sure you have the nfs-kernel-server package installed and running

2)
Add this entry in the file /etc/exports

/home 192.168.0.0/255.255.255.0(rw)

NIS
1) Modify the file /var/yp/Makefile to the following:
*)
< MINUID=1000
< MINGID=1000
---
> MINUID=4
> MINGID=500

*)
< MERGE_PASSWD=false
---
> MERGE_PASSWD=true

*)
< merge_group="false"
---
> MERGE_GROUP=true

*)
< ALIASES = /etc/aliases
---
> ALIASES = /etc/aliases.yp

*)
< GROUP = $(YPPWDDIR)/group
< PASSWD = $(YPPWDDIR)/passwd
---
> GROUP = $(YPPWDDIR)/group.yp
> PASSWD = $(YPPWDDIR)/passwd.yp

3) The NIS domain
(This differs from other distributions)

Set the NIS domain in the file /etc/defaultdomain
ypdomain.logiccroft.de

4) Configure NIS service to be a server
Edit the file /etc/default/nis

NISSERVER=master

You might consider setting
NISCLIENT=false

..but you can leave it until were done testing.

If you do want to test the domainserver locally, you'll have to add the followin line in /etc/yp.conf:

ypserver 192.168.0.2

(Please use the IP number and not IP name for security reasons and for ease of setting up and usa in case nameservice is broken).

5) build the service database
cd /etc
cp aliases aliases.yp

cp group group.yp
cp passwd passwd.yp
(edit each destination file above and remove unwanted entries)
cd /usr/lib/yp
./ypinit -m

6) Test the service locally - Optional
/etc/init.d/nis stop
/etc/init.d/nis start
ypcat passwd

7) Test the service on a client
Log in as root on the client and:

/etc/nfs stop
/etc/nfs start
/etc/nis stop
/etc/nis start

Repeat the process as in 6)

2 comments:

  1. > MINUID=4
    > MINGID=500

    Is wrong... It should be the opposite:

    > MINUID=500
    > MINGID=4

    ReplyDelete
  2. i tried your way for nfs i got it. thanks but frn can u tel me how to create a nis user on server and log from any client on the lan, irrespective of where ever i log in from i always get access to my personal directory on server. thanku my mail id is jossy.pankaj@gmail.com or pankaj_jossy@yahoo.com

    ReplyDelete