Other Articles

Servers – Ensure Root is the Only UID 0 Account

Support > Fixing Checks > Server

06 March, 2026

This check ensures that the root account is the only account with UID 0 on the system. In Linux systems, any user account with UID 0 automatically receives superus (root-level) privileges.

If additional accounts are assigned UID 0, they gain full administrative control of the system. Restricting UID 0 access to only the default root account helps maintain proper privilege separation and prevents unauthorized administrative access.

Check Details

  • Resource: Server
  • Check: Verify Only Root UID
  • Risk: If multiple user accounts have UID 0, they gain full superuser privileges, which can allow unauthorized administrative access and increase the risk of system compromise.

Remediation Steps

  1. Open a terminal session on the server with root or sudo privileges.
  2. Identify all user accounts that have UID 0.

    awk -F: '($3 == 0) { print $1 }' /etc/passwd
    
  3. Verify that the command output lists only the root user. If any other usernames appear, they must be corrected.
  4. If an unnecessary user account has UID 0, remove that user from the system.

    sudo userdel <username>
    
  5. Alternatively, if the user account should remain on the system, assign it a new non-privileged UID.

    sudo usermod -u <new_uid> <username>
    
  6. After making the changes, run the audit command again to confirm that only the root account has UID 0.