# Ensure Permissions on SSH Private Host Key Files Are Configured

- Source: https://support.icompaas.com/support/solutions/articles/62000235407-ensure-permissions-on-ssh-private-host-key-files-are-configured
- 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:  
 SSH private host key files are critical for securing SSH server authentication. Proper permissions prevent unauthorized users from accessing these keys, which could compromise the server’s identity and security.

Rationale:  
 Restricting access to SSH private host keys protects against key theft and unauthorized SSH access, maintaining the integrity and trustworthiness of SSH connections.

Impact:  
 **Pros**:

-   Protects SSH server authentication keys.  
      
    
-   Prevents unauthorized SSH access via stolen keys.  
      
    

**Cons:**

-   **Incorrect permissions may cause SSH service failures.  
      
    **
    

**Default Value:  
 SSH private keys may have overly permissive permissions if not configured properly.**

**Pre-requisites:**

-   **Root or sudo privileges to modify file permissions.  
    **
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

**Identify SSH private host key files, typically located in /etc/ssh/ (e.g., ssh\_host\_rsa\_key, ssh\_host\_ecdsa\_key, ssh\_host\_ed25519\_key):  
  
ls -l /etc/ssh/ssh\_host\_\*\_key**

1.  **Verify permissions and ownership of each key file.**
    

### **Implementation Plan:**

**Using Linux command line:**

**Set ownership to root and restrict permissions to 600 on all private host key files:**

chown root:root /etc/ssh/ssh\_host\_\*\_key  

  

chmod 600 /etc/ssh/ssh\_host\_\*\_key

**Verify the changes:  
**

ls -l /etc/ssh/ssh\_host\_\*\_key

### **Backout Plan:**

**Using Linux command line:**

1.  **Restore previous ownership and permissions if necessary.  
      
    **
    
2.  **Verify SSH service functionality after changes.  
    **
    

**References:**

-   **CIS Amazon Linux 2 Benchmark v3.0.0  
      
    **
    
-   **OpenSSH Manual  
      
    **
    
-   **[NIST SP 800-53 Revision 5 - SC-12  
      
    ](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final#sc-12)**

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