# Ensure Chrony Service Does Not Run as Root User

- Source: https://support.icompaas.com/support/solutions/articles/62000235155-ensure-chrony-service-does-not-run-as-root-user
- 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:** Chrony is a network time protocol (NTP) client and server used to synchronize system clocks. Running chrony as the root user increases security risks if the service is compromised. Running it under a less privileged user minimizes potential damage.

**Rationale:** Running chrony with reduced privileges limits the impact of potential exploits or vulnerabilities, improving overall system security.

**Impact:** Pros:

-   Reduces risk associated with running services as root.  
    
-   Limits scope of damage if chrony is compromised.  
    

Cons:

-   Requires proper configuration and testing to ensure chrony runs correctly under a non-root user.  
    

**Default Value:** Chrony typically runs as root by default on many systems.

**Pre-requisites:**

-   Root or sudo privileges to modify service configurations.  
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

1.  Check the user running chrony service:  
    
    ps -ef | grep chronyd
    
      
    
2.  Verify chrony is not running as root.  
      
    

### **Implementation Plan:**

**Using Linux command line:**

1\. Modify chrony service configuration to run as a non-root user, for example:  

2\. Create a dedicated user (if not existing):  

useradd -r -s /sbin/nologin chrony

3\. Edit /etc/systemd/system/chronyd.service or relevant service file to include:

User=chrony
Group=chrony

4\. Reload systemd and restart chrony:  

systemctl daemon-reload  
systemctl restart chronyd

5\. Verify the service runs under the non-root user.  

### **Backout Plan:**

**Using Linux command line:**

1.  Revert service configuration to run as root by removing or commenting out the User directive.
    
2.  Reload systemd and restart chrony service.  
    
3.  Verify chrony runs as root again.  
    

**References:**

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   Chrony Documentation  
    
-   Systemd Service Files

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