Installing pam_mount on Ubuntu 14.04

The PAM module pam_mount allows one to mount drives at logon using the logon username and password (and unmounts at logoff). This is particularly useful for mounting network drives for users.

Install the PAM module

sudo apt-get update
sudo apt-get install libpam_mount

Configure PAM

With Ubuntu 14.04, installing the module does not enable it. We need to do this manually.

sudoedit /etc/pam.d/common-session and insert the following line just before the final comment (i.e., as the last session entry) unless you have special PAM needs (it must come before any sufficient entries).

session optional pam_mount.so

Then sudoedit /etc/pam.d/common-auth and insert the following just before the final comment (with the same provisos as above).

auth optional pam_mount.so

Complete

That is it. The module will be available at next login.

Now
sudoedit /etc/security/pam_mount.conf.xml to your particular need.

Leave a comment