Subject: Re: NIS Client
To: None <netbsd-help@NetBSD.org, netbsd-users@NetBSD.org>
From: Mike Parson <mparson@bl.org>
List: netbsd-help
Date: 03/23/2004 13:50:35
On Tue, Mar 23, 2004 at 04:05:22PM +0200, Selvan Naidoo wrote:
> Hi all,
> 
> I have 2 NetBSD 1.6.1 boxes, one of which is setup as a NIS server and the
> other, a NIS client.
> I can create new users and modify existing users on the server and propagate
> the changes of the "passwd" and "master.passwd" files to the client.
> 
> I can login at the client unit with the new user accounts or the existing
> user accounts.
> 
> The problem that I am having is that there are no "/home/<user>" accounts on
> the client unit.
> The "/home/<user>" accounts exist on the server unit only.
> 
> How can I use the server's "/home/<user>" directory when login in at the
> client.
> 
> I've read that this can be done using NFS however there isn't much help on
> setting-up NFS on NetBSD.

On the server: 

1.  Add to /etc/rc.conf:

# NFS daemons and parameters.
mountd=YES              mountd_flags=""         # NFS mount requests daemon
nfs_server=YES                                   # enable server daemons
                        nfsd_flags="-6tun 4"
lockd=YES               lockd_flags=""
statd=YES               statd_flags=""

2.  In /etc/exports (man 5 exports):

/home	-maproot=root ip.of.client.box


3.  Reboot, or run the appropriate scripts out of /etc/rc.d to start up
    the services you just turned on above (nfsd, mountd, lockd, statd).


On the client:

1.  Add to /etc/rc.conf:

nfs_client=YES                                  # enable client daemons


2.  add to /etc/fstab  (man 5 fstab):

ip.of.server.box:/home	/home	nfs	rw	0 0

3.  reboot, or start up nfslocking, then mount /home:

client.box# mount /home

Since you've already got NIS working, all the other RPC processes should
be going.

> Any help will be greatly appreciated.

This is rough, and off the top of my head, read the man pages I put in
()s if anything doesn't work out right.  I don't think I've put anything
here that would render your box unusable, worse thing that would happen
is the server rejecting the nfs mount request.

-- 
Michael Parson
mparson@bl.org