Error "passwd: Unknown user name 'root'." is shown when attempting to change root password

Solution Verified - Updated -


Unable to change root password - seeing error messages similar to the following:

# passwd 
passwd: Can not identify you!
# passwd root
passwd: Unknown user name 'root'.
# whoami
whoami: cannot find name for user ID 0


  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Using NIS Authentication

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