RHEL6 – Network Mounting User Home Directories

Cartoon-house-008Seriously, who does not hate users and their home directories? However if it wasn’t for them, then nothing would ever break and the life of a sysadmin would be a very boring one. Anyway back to the subject at hand.

First off, in order to mount a users home directory automatically upon login you need to make sure that you have autofs installed and configured to start at boot.

Note that for this example lets assume that our home directories are shared via nfs on the server, nfsserver.example.com, on the exported volume /nfs/home/

So first, on your local system, install autofs via yum if its not already installed.

$ sudo yum install autofs

Then extend the configurations of your automounter to mount the /nfs/home directory by adding the following line to the bottom of /etc/auto.master. The auto.master is a master map for the automounter, and it is referenced each time autofs is involked.

/nfs/home   /etc/auto.guests

In the example above, all accesses to /nfs/home will be directed to the map in /etc/auto.guests

Now obviously we are going to need to  create a file called /etc/auto.guests.  Here you will add the line below.

*    nfsserver.example.com:/nfs/home/&

Here we are using the metacharacter “&” to elimiate the need to list out each and every username. By doing so each users home directory is mapped by default.

Then start the automounter

#service autofs start

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s