Configure idmapd, NFSv4, and autofs

To mount NFSv4 exports you will need to make small edits to two files.

Uncomment the following line in /etc/sysconfig/nfs:

SECURE_NFS="yes"

Find the following lines in /etc/idmapd.conf (in different sections) and modify like this:

Domain = mydept.example.com

Nobody-User = nfsnobody
Nobody-Group = nfsnobody

At this point you should reboot for the changes to take effect (or at least restart rpcgssd and rpcidmapd).

Log in as root for the next steps. This is so that we can setup automounted home directories (without files under /home being currently in use).

First of all, you can test your NFSv4 configuration by trying to mount an NFSv4 export:

mkdir /nfs4
kinit netid
mount -t nfs4 -o \
   rw,proto=tcp,port=2049,sec=krb5p \
   nfs4svr.mydept.example.com:/home /nfs4
ls /nfs4
umount /nfs4

Assuming that works, you need to move /home so that it can be automounted via NFSv4:

mv /home /var/local/
ln -s /nfs4/home /home
yum -i install autofs

Any local accounts will need to have their home path modified to point to /var/local/home/:

sudo usermod -d /var/local/home/myuser myuser

You will also want to change the default HOME for local users in /etc/default/useradd.

We will assume the NFSv4 server nfs4svr.mydept.example.com has already been configured to export /home (as well as some shared workspaces) when the client attempts to mount nfs4svr.mydept.example.com:/& .

Create the file /etc/auto.nfs4 containing this one line:

-fstype=nfs4,rw,proto=tcp,port=2049,sec=krb5p nfs4svr.mydept.example.com:/&

Then add this line to /etc/auto.master:

/nfs4 /etc/auto.nfs4 --timeout=90

Restart autofs for your changes to take effect:

/sbin/service autofs restart

Logout of the root session.