How to safely change a user account with UID 0 (other than root) to a non-privileged UID on RHEL

Solution Verified - Updated -

Issue

  • A non-root user account (for example admin) was created with UID 0, giving it full root privileges.

  • The system administrator wants to change this user to a non-privileged UID without breaking services or file ownership.

Environment

  • Red Hat EnterpriseLinux 8.x

  • Local user account with UID 0 (same as root)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content