# Ensure Password Fields in /etc/shadow Are Not Empty

- Source: https://support.icompaas.com/support/solutions/articles/62000235397-ensure-password-fields-in-etc-shadow-are-not-empty
- 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 /etc/shadow file stores user password hashes and related information. Empty password fields indicate accounts with no password set, which pose a serious security risk by allowing unauthorized access.

Rationale:  
 Ensuring password fields are not empty prevents accounts from being accessed without authentication, thereby enhancing system security.

**Impact:  
** **Pros:**

-   Prevents unauthorized access via passwordless accounts.  
    
-   Strengthens overall authentication controls.  
    

**Cons:**

-   Accounts with empty passwords may be service or system accounts needing special handling.  
    

Default Value: Password fields may be empty due to misconfiguration or legacy accounts.

Pre-requisites:

-   Root or sudo privileges to audit and modify user accounts.  
    

Remediation:

### Test Plan:

Using Linux command line:

1\. Identify accounts with empty password fields in /etc/shadow:   

awk -F: '($2 == "" ) {print $1}' /etc/shadow

2\. Verify that the list is empty.  
  

### Implementation Plan:

Using Linux command line:

1\. For accounts with empty passwords, set a secure password or disable the account:   

passwd <username>
passwd -l <username>  # To lock the account if needed

2\. Verify changes are applied.  
  

### Backout Plan:

Using Linux command line:

1.  Restore previous password states from backups if necessary.  
    
2.  Communicate with affected users about password changes.  
      
    

References:

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   [NIST SP 800-53 Revision 5 - IA-5  
      
    ](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final#ia-5)

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