How To Install libnss-mysql on AlmaLinux 8

In this tutorial we learn how to install libnss-mysql in AlmaLinux 8. libnss-mysql is NSS library for MySQL

Introduction

In this tutorial we learn how to install libnss-mysql on AlmaLinux 8.

What is libnss-mysql

Store your UNIX user accounts in MySQL. “libnss-mysql” enables the following * System-wide authentication and name service using a MySQL database. Applications do not need to be MySQL-aware or modified in any way. * Storing authentication information in a database instead of text files. * Creation of a single authentication database for multiple servers. This is often referred to as the “Single Sign-on” problem. * Writing data-modification routines (IE self-management web interface). libnss-mysql is similar to NIS or LDAP. It provides the same centralized authentication service through a database. What does this mean? Username, uid, gid, password, etc comes from a MySQL database instead of /etc/password, /etc/shadow, and /etc/group. A user configured in MySQL will look and behave just like a user configured in /etc/passwd. Your applications such as ls, finger, sendmail, qmail, exim, postfix, proftpd, X, sshd, etc. will all ‘see’ these users!

We can use yum or dnf to install libnss-mysql on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install libnss-mysql.

Install libnss-mysql on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install libnss-mysql

Install libnss-mysql on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install libnss-mysql using yum by running the following command:

sudo yum -y install libnss-mysql

How To Uninstall libnss-mysql on AlmaLinux 8

To uninstall only the libnss-mysql package we can use the following command:

sudo dnf remove libnss-mysql

References

Summary

In this tutorial we learn how to install libnss-mysql on AlmaLinux 8 using yum and dnf.