YO
7 2
Asked
Updated
Viewed
220.3k times

How can you change the root password on a Linux Red Hat or Centos server?

add a comment
1

1 Answer

  • Votes
  • Oldest
  • Latest
ME
25 0
Answered
Updated

To update the password for root user, follow these steps:

  1. Open a shell window on the server or computer.
  2. Su to root user which may ask you to enter root's current password.
  3. Type passwd.
  4. When it prompts for new password provide it.
  5. Confirm your password to finalize the change.

Here is what it will look like from your command shell or terminal:

$ su
Password: *********

# passwd
Password for root: *********
Type new UNIX password: *********
Retype new UNIX password: *********
passwd: password updated successfully

At this point the password for the root user is changed. Next time you try to su to root (switch user to root) you will need to enter your new password that you just set.

1