How To Install libpam-mklocaluser on Debian 11

In this tutorial we learn how to install libpam-mklocaluser on Debian 11. libpam-mklocaluser is Configure PAM to create a local user if it do not exist already

Introduction

In this tutorial we learn how to install libpam-mklocaluser on Debian 11.

What is libpam-mklocaluser

libpam-mklocaluser is:

When the user logs in for the first time, a local POSIX user account is created in /etc/passwd and primary group created in /etc/group, and a local home directory is created in /home.

This is useful on roaming computers when the password is set up to be cached by for example libpam-ccreds or sssd to allow login without network connectivity using the password provided by a network authentication service like Kerberos or LDAP.

Other than the caching mechanisms of libpam-ccreds or libpam-sssd / libnss-sssd, the libpam-mklocaluser approach makes the LDAP accounts more persistent on the roaming workstation and robust again credentials cache deletions and such.

The pam_mklocaluser PAM module additionally allows for execution of additional hook scripts when users log in to such a roaming computer for the first time.

There are three methods to install libpam-mklocaluser on Debian 11. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libpam-mklocaluser Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libpam-mklocaluser using apt-get by running the following command:

sudo apt-get -y install libpam-mklocaluser

Install libpam-mklocaluser Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libpam-mklocaluser using apt by running the following command:

sudo apt -y install libpam-mklocaluser

Install libpam-mklocaluser Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libpam-mklocaluser using aptitude by running the following command:

sudo aptitude -y install libpam-mklocaluser

How To Uninstall libpam-mklocaluser on Debian 11

To uninstall only the libpam-mklocaluser package we can use the following command:

sudo apt-get remove libpam-mklocaluser

Uninstall libpam-mklocaluser And Its Dependencies

To uninstall libpam-mklocaluser and its dependencies that are no longer needed by Debian 11, we can use the command below:

sudo apt-get -y autoremove libpam-mklocaluser

Remove libpam-mklocaluser Configurations and Data

To remove libpam-mklocaluser configuration and data from Debian 11 we can use the following command:

sudo apt-get -y purge libpam-mklocaluser

Remove libpam-mklocaluser configuration, data, and all of its dependencies

We can use the following command to remove libpam-mklocaluser configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libpam-mklocaluser

Dependencies

libpam-mklocaluser have the following dependencies:

References

Summary

In this tutorial we learn how to install libpam-mklocaluser package on Debian 11 using different package management tools: apt, apt-get and aptitude.