Server Setup for Autohomes
We will be exporting the /exports/ahome filesystem. Edit /etc/exports to include this entry:
/exports/ahome gss/krb5p(rw,fsid=0,insecure,no_subtree_check,sync,anonuid=65534,anongid=65534)
Since you have changed the export configuration and need to re-export, you should use:
[root@nfs1 ~]# exportfs -rv exporting gss/krb5p:/exports/ahome exporting gss/krb5p:/exports/distros exporting gss/krb5p:/exports/sge exporting gss/krb5p:/exports/users
Client Setup for Autohomes
On the client, the automounter is configured with the /etc/auto.master file and the associated /etc/auto.mountpoint files. The automounter is started and stopped with the /etc/init.d/autofs init script. When users login, they will be in their their automounted home directories.
Edit the /etc/auto.master config file.
# # $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $ # # Sample auto.master file # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # For details of the format look at autofs(5). # /ahome /etc/auto.ahome --timeout=90
Now create the /etc/auto.ahome config file:
* -fstype=nfs4,rw,proto=tcp,port=2049 nfs1:/&
Now, create the mountpoint:
[root@client ~]# mkdir /ahome
We assume you are using LDAP to store users and that you can change all the home directories there.
Now, let's configure the automounter to start automatically and then start it:
[root@client ~]# chkconfig autofs on [root@client ~]# service autofs restart [root@client ~]# mount | grep /ahome automount(pid8044) on /ahome type autofs (rw,fd=4,pgrp=8044,minproto=2,maxproto=4)
Now, use SSH to login as one of the example users, such as 'hnelson'. If you have completed the Trail for configuring Kerberos authentication with SSHD, you would be able to SSH and login without being prompted for a password.
$ ssh hnelson@client hnelson@client's password: $ pwd /ahome/hnelson $ mount | grep ahome automount(pid8044) on /ahome type autofs (rw,fd=4,pgrp=8044,minproto=2,maxproto=4) nfs1:/hnelson on /ahome/hnelson type nfs4 (rw,proto=tcp,port=2049,addr=10.0.0.1) $ df -h | grep ahome nfs1:/hnelson 1.5G 55M 1.4G 2% /ahome/hnelson
Postconditions
- After a user logs out, their NFSv4 mount entry will disappear after 90 seconds.
- The user on the NFSv4 client will not be able to exceed their quota.
- To stop using the automounter, remove relevant entries from the auto.master and restart the service. You must also modify its runlevels with the chkconfig command.