# Ensure pam_unix Includes a Strong Password Hashing Algorithm

- Source: https://support.icompaas.com/support/solutions/articles/62000235465-ensure-pam-unix-includes-a-strong-password-hashing-algorithm
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Amazon Linux 2 Benchmark v3.0.0](https://support.icompaas.com/support/solutions/62000112696) › [CIS Amazon Linux 2 Benchmarks](https://support.icompaas.com/support/solutions/folders/62000169265)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:** • Level 1

**Description:**  
 The pam\_unix module handles authentication using UNIX passwords. Configuring it to use a strong hashing algorithm such as SHA-512 enhances password security by making stored password hashes more resistant to brute-force and dictionary attacks.

**Rationale:** Using a strong password hashing algorithm protects against password cracking by increasing computational difficulty for attackers attempting to recover plaintext passwords.

**Impact:** Pros:

-   Enhances password storage security.  
    
-   Supports compliance with security best practices and standards.  
    

Cons:

-   May slightly increase authentication processing time.  
    

**Default Value:** Many modern Linux distributions use SHA-512 by default, but this should be verified.

**Pre-requisites:**

-   Root or sudo privileges to modify PAM configuration.  
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

1.  Check PAM configuration files for the pam\_unix hashing algorithm  
    
    grep pam\_unix /etc/pam.d/system-auth  
    grep pam\_unix /etc/pam.d/common-password
    
      
    
2.  Verify that sha512 is included in the module options.
    

### **Implementation Plan:**

**Using Linux command line:**

1\. Edit PAM password configuration file:  

vi /etc/pam.d/system-auth

2\. Add or ensure sha512 is included in the pam\_unix line, for example:

password sufficient pam\_unix.so sha512 shadow nullok try\_first\_pass use\_authtok

3\. Save the file.  

### **Backout Plan:**

**Using Linux command line:**

1.  Remove or modify the hashing algorithm option if necessary.  
    
2.  Test password changes to confirm functionality.  
    

**References:**

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   pam\_unix Documentation  
    
-   [NIST SP 800-63B - Digital Identity Guidelines  
    ](https://pages.nist.gov/800-63-3/sp800-63b.html)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
