# Ensure pam_unix Module Does Not Include Nullok Option

- Source: https://support.icompaas.com/support/solutions/articles/62000235463-ensure-pam-unix-module-does-not-include-nullok-option
- 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 nullok option in the pam\_unix module allows users to authenticate with empty (null) passwords. Removing this option ensures that null passwords are not accepted, strengthening authentication security.

**Rationale:** Disabling nullok prevents the use of empty passwords, reducing the risk of unauthorized access due to weak or blank passwords.

**Impact:** Pros:

-   Enforces that users must have non-empty passwords.  
    
-   Enhances system security by preventing trivial authentications.  
    

Cons:

-   May cause authentication failures if any accounts rely on null passwords (which is insecure and not recommended).  
    

**Default Value:** The nullok option is sometimes included by default, depending on system configuration.

**Pre-requisites:**

-   Root or sudo privileges to modify PAM configuration files.  
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

1.  Check PAM configuration files (e.g., /etc/pam.d/system-auth or /etc/pam.d/common-auth) for pam\_unix and nullok:  
    
2.  grep pam\_unix /etc/pam.d/system-auth  
    grep nullok /etc/pam.d/system-auth  
    grep pam\_unix /etc/pam.d/common-auth  
    grep nullok /etc/pam.d/common-auth
    
      
    
3.  Verify if the nullok option is present.
    

### **Implementation Plan:**

**Using Linux command line:**

1\. Edit PAM configuration files to remove nullok from pam\_unix lines:

vi /etc/pam.d/system-auth

2\. Locate lines with pam\_unix.so and remove the nullok option if present, for example:

auth required pam\_unix.so try\_first\_pass

3\. Save the file and repeat for other relevant PAM files like /etc/pam.d/common-auth.  

### Backout Plan:

Using Linux command line:

1.  Re-add the nullok option if necessary by editing the PAM files.
    
2.  Test authentication to verify behavior.  
    

**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.
