cancel
Showing results for 
Search instead for 
Did you mean: 
Robert1
Mission Specialist
Mission Specialist
  • 2,209 Views

change root password

Trying to practice for the exam.

Set up a RHEL 7.5 VM on both V-Box and VMware.

I follow steps posted on Youtube...several versions... all with the same result.

When the box boots back up, none of the passwords work. Not root, not admin, not even my user password.

It's like they all got erased during the process but all I changed was root.

Any guidance?

Also...can not find anywhere in the RH 124, or 134 material how to change root.

THanks- R

Labels (1)
0 Kudos
2 Replies
varelov
Flight Engineer Flight Engineer
Flight Engineer
  • 2,200 Views

Any error messages you'd like to share? What YouTube videos are you referring to? Were you erasing /etc/shadow at any point, was that the instruction YouTube videos gave? Did you force SELinux to relabel newly edited file(s)?

0 Kudos
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 2,195 Views

@Robert1 

If you truly have access to the RH134 material, you fill find the answer in Chapter 13, sections 3 (lesson) and 4 (practice lab).

This is known as "recoving the root password" -- but there is no "recover" about it, you'll be changing it.

It is basically a 6-step process:

  1. stop the boot process by editing grub - this involves adding rd.break to the end of the linux16 line
  2. remount the filesystem as read/write using the mount command
  3. use /sysroot as / by using chroot
  4. reset the root password using the passwd command
  5. create the .autorelabel (don't forget the dot before the a!) file in / to force SELinux relabeling
  6. type exit twice to reboot the system

...and wait until the system reboots. Now you can use the new root password.

When I searched on "password recovery rhel7" on Google, the very first YouTube video I found was 100% spot-on, "How to reset the root password on RHEL 7 and CentOS 7 - YouTube"

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Join the discussion
You must log in to join this conversation.