Upgrading Linux PAM version 1.5.3 to 1.1.4: Adding Password History and Complexity with Linux PAM Library

Abstract: Enforce password complexity and history on Linux PAM 1.5.3 by configuring pam_pwquality.so and pam_pwhistory.so without downgrading to version 1.1.4

Created: 2026-10-10 by

Modern Linux systems running PAM 1.5.3 already include robust password complexity and history features via pam_pwquality.so. Downgrading to version 1.1.4 is unnecessary, dangerous, and removes critical security patches. To enforce strong passwords, you only need to configure the existing modules in /etc/pam.d/system-auth or /etc/pam.d/password-auth.

The Danger of Downgrading PAM

Linux distributions package PAM with significant security updates between major versions. Moving from a modern release like 1.5.3 back to an older legacy version such as 1.1.4 exposes your system to known vulnerabilities that have been patched for years. This action breaks compatibility with current authentication services, potentially locking out administrators or causing login failures across the entire system.

Furthermore, older PAM versions lack support for modern cryptographic standards required by contemporary applications. They do not handle Unicode characters in passwords correctly, leading to inconsistent validation results. The risk of introducing a downgrade far outweighs any perceived benefit, as the functionality you seek is already present in the current library.

Configuring Password Complexity with pam_pwquality

The standard method for enforcing password policies on RHEL, CentOS, Fedora, and compatible distributions is the pam_pwquality.so module. This module replaces the deprecated pam_cracklib.so and provides comprehensive checks for password strength, history, and reuse.

To implement these rules, edit the appropriate PAM configuration file. On most systems, this is /etc/pam.d/system-auth for local users and /etc/pam.d/password-auth for remote access. Locate the line containing pam_pwquality.so or pam_cracklib.so. If it is missing, add the following line after the pam_unix.so entry:

password    requisite     pam_pwquality.so retry=3 minlen=12 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 enforce_for_root

This configuration enforces several critical security measures simultaneously. The minlen=12 parameter sets the minimum password length to twelve characters, which is the current industry best practice. The ucredit, lcredit, dcredit, and ocredit parameters require at least one uppercase letter, one lowercase letter, one digit, and one special character, respectively.

The retry=3 flag allows users three attempts before the system rejects the input entirely. The enforce_for_root option ensures that even the root user must adhere to these complexity rules, preventing weak administrative credentials. You can adjust these values based on your specific organizational policy, but reducing them below these thresholds significantly weakens security.

Enforcing Password History

Password history prevents users from reusing recent passwords, mitigating the risk of brute-force attacks on old credentials. This feature is controlled by the pam_pwhistory.so module. Similar to complexity settings, this module is included in modern PAM distributions and does not require a version downgrade.

Add the following line to your PAM configuration files, typically placing it before the pam_unix.so password line:

password    sufficient    pam_pwhistory.so remember=5 use_authtok

The remember=5 directive instructs the system to track the last five passwords. Users will be unable to set any of those previous passwords as their new credential. The use_authtok flag ensures that the module uses the authentication token provided by the preceding module, ensuring consistency in validation.

If you are managing a large enterprise environment, consider integrating with LDAP or Active Directory for centralized password policies. Local PAM configurations are excellent for standalone servers but become difficult to maintain at scale. For detailed guidance on securing server access broadly, see our guide on Securing an Ubuntu Server for Development Purposes.

Verifying Your Configuration

After modifying the PAM files, test the changes immediately using a non-root user account. Attempt to set a weak password to verify that the complexity checks trigger correctly. Then, try setting a password that matches one of the previous five entries to confirm the history enforcement works.

Check the system logs for any authentication errors. On systemd-based systems, use journalctl -f while attempting a password change to view real-time PAM messages. Look for lines indicating pam_pwquality rejection reasons, such as "BAD PASSWORD" or "too short".

Ensure that your backup mechanisms are intact before making broad changes. If you accidentally lock yourself out due to a misconfiguration, you may need to boot into rescue mode to restore the original PAM files. Always keep a terminal session open with root privileges when editing PAM configurations to avoid accidental lockouts.

Related Security Measures

Password complexity is just one layer of defense. Consider restricting SSH access to specific groups to limit exposure. Our article on Restricting SSH Access for wheel Group Users in Red Hat 9 using PAM's pam_access.so - Not Denying Access explains how to further harden your authentication pathways.

Additionally, ensure that your system is not vulnerable to network-level attacks that could bypass local password policies. Tools like iptables can help block malicious MAC addresses during active attacks, as discussed in Block MAC Address with Iptables During Attack.

Frequently Asked Questions

Can I still use pam_cracklib instead of pam_pwquality?

No, pam_cracklib.so is deprecated and removed in modern PAM versions. Using it will cause authentication failures because the module no longer exists in the library path. You must migrate to pam_pwquality.so for all password quality checks.

Why does my root user ignore password complexity rules?

By default, many PAM configurations exclude the root user from complexity checks for administrative convenience. Add the enforce_for_root option to your pam_pwquality.so line to override this behavior and apply rules universally.

How do I reset the password history count?

There is no built-in command to clear password history for individual users. The history is stored in /etc/security/opasswd. You can delete this file to reset history for all users, but this should be done cautiously as it removes protection against password reuse for everyone.

Does PAM 1.5.3 support Unicode passwords?

Yes, modern PAM versions fully support Unicode characters in passwords. Older versions like 1.1.4 often failed to validate multi-byte characters correctly, leading to login issues for users with international names or symbols.

What happens if I disable password aging?

Disabling password aging means users never have to change their passwords. While convenient, this increases the window of opportunity for attackers who compromise a credential. It is recommended to keep aging enabled alongside complexity requirements for a balanced security posture.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More