Table of Contents

Auto mounting the user's home directory through NFS

With the help of the NFS protocol, you can mount the user's home directory which is on a remote host (server) while he is logging in. For that, you need to synchronize the uid/gid between the remote and the local host. If you need to modify one or the other, use:

usermod
#or
groupmod

Remote host configuration

You need the nfs-kernel-server package. On Debian do:

apt-get install nfs-kernel-server

Add the following to the /etc/export file:

/home  *(rw,sync,root_squash)

and reload/verify the exportation list with:

exportfs -a
exportfs -v

user host

You need the nfs-common and the autofs packages. On Debian do:

apt-get install nfs-common autofs

Edit the /etc/auto.master file and add a link to /etc/auto.home:

#
# File: /etc/auto.master
#
/home   /etc/auto.home --timeout=300
/-      /etc/auto.direct

Edit/Create the /etc/auto.home file and add the following lines (refer to man page for options):

#
# File: /etc/auto.home
#
*  -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp \
   remoteHost:/home:&
  1. Remote Disk Access with NFS An How-to from the Linux Home Networking.
  2. Configuring NIS An How-to from the Linux Home Networking.