Monday, 17 May 2004, 00:00 - Technology
Follow those steps for automounting every user's homedir under a particular directory:Make sure you have installed autofs
Add the following line to the automount.master file (mostly in /etc/autofs/):
/home/net /etc/autofs/auto.home
Then Add this line to auto.home (mostly in /etc/autofs/):
* -rw,soft,intr server:/&
or for a SAMBA server:
* -rw,soft,intr,fstype=smbfs,uid=&,gid=100,credentials=/home/&/.smbpasswd ://server/&
But what does that mean?
The Asterisk (*) stands for any (pseudo)-directory under the given mountpoint. After the dash, there are the mount options, and with the Ampersand (&) we refer to the directory name that would be accessed by the user. So the appropriate NFS export or sharename will be automounted. For SAMBA, it is used also for setting the owner of the files in the mounted directory and for the credentials file in user's (local) home directory for authentication.
With this, users can just use their home directory on a server, e.g. by cd'ing to /home/net/<username>. After some time of inactivity, the directory will be unmounted without manual intervention.