How To Install pam_mount on CentOS 7

In this tutorial we learn how to install pam_mount on CentOS 7. pam_mount is A PAM module that can mount volumes for a user session

Introduction

In this tutorial we learn how to install pam_mount on CentOS 7.

What is pam_mount

This module is aimed at environments with central file servers that a user wishes to mount on login and unmount on logout, such as (semi-)diskless stations where many users can logon and where statically mounting the entire /home from a server is a security risk, or listing all possible volumes in /etc/fstab is not feasible. * Users can define their own list of volumes without having to change (possibly non-writable) global config files. * Single sign-on feature - the user needs to type the password just once (at login) * Transparent mount process * No stored passwords * Volumes are unmounted on logout, freeing system resources and not leaving data exposed. The module also supports mounting local filesystems of any kind the normal mount utility supports, with extra code to make sure certain volumes are set up properly because often they need more than just a mount call, such as encrypted volumes. This includes SMB/CIFS, FUSE, dm-crypt and LUKS. If you intend to use pam_mount to protect volumes on your computer using an encrypted filesystem system, please know that there are many other issues you need to consider in order to protect your data. For example, you probably want to disable or encrypt your swap partition (the cryptoswap can help you do this). Do not assume a system is secure without carefully considering potential threats.

We can use yum or dnf to install pam_mount on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install pam_mount.

Install pam_mount on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install pam_mount using yum by running the following command:

sudo yum -y install pam_mount

Install pam_mount on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install pam_mount using dnf by running the following command:

sudo dnf -y install pam_mount

How To Uninstall pam_mount on CentOS 7

To uninstall only the pam_mount package we can use the following command:

sudo dnf remove pam_mount

References

Summary

In this tutorial we learn how to install pam_mount on CentOS 7 using yum and dnf.