PAM mount: Automatically Mount Network Shares at Login
Introduction
You may need sometimes to automatically mount network shares. This can be done with the pam_mount module.
Installation
For installation:
Configuration
pam_mount.conf
Edit the /etc/security/pam_mount.conf
file and configure what you need. Here we would like users to have nfs home share to be mounted from the server at logon. Add this line at the end of the file:
You may also need to have other mount points for other things like smb, cifs or fuse:
Application
You must choose an application to mount automatically your share. For example I choose SSH. When a user logs into SSH it must mount the NFS share, so edit this file:
Now when you'll login, it will automatically mount your home.