cancel
Showing results for 
Search instead for 
Did you mean: 
ronald992
Cadet
Cadet
  • 255 Views

Crack root password

Recently a week back I had attempted RHCSA certification and tried the below command but unfortunately was not successful in rhel 8 , does any one know otherway to crack root password.
Linux line end added rd.break - ctrl x - mount -o remount,rw /sysroot - chroot /sysroot -passwd root , changed the password and got message authentication successful and then touch /.autorelable and then exit and logout
0 Kudos
4 Replies
Vincent2
Mission Specialist
Mission Specialist
  • 249 Views

Re: Crack root password

I tried this also and it did not work... but this method worked for me.

#1. delete rhgb.silent with rd.break   also add   enforcing=0 (replaces the need for touch /.autorelable)

#2. mount -o remount,rw /sysroot (add read and write to the sysroot dir)

#3 chroot /sysroot

#4 whoami to check if you are root.

#5 passwd enter the new root password twice

#6 mount -o remount,ro / (add read only to the root dir)

#7 exit to get out of that directory

#8 reboot

#9 select the root user and login with the new password

Hope this helps Smiley Happy Let me know if this is correct

 

0 Kudos
Reply
Loading...
ronald992
Cadet
Cadet
  • 236 Views

Re: Crack root password

Thanks , sure let me try this and confirm
0 Kudos
Reply
Loading...
Cyrille_V
Cadet
Cadet
  • 195 Views

Re: Crack root password

ronald992, don't forget to create an autoelabel file, BEFORE reboot (if selinux is enforcing on this box). Otherwise SELinux will refuse to recognize "touched" /etc/passwd and /etc/shadow files after your reboot and you will not be able to login at all and need to repeat this action again. Just do:

#> touch /.autorelabel     with dot)

and then reboot

SELinux will do re-labeling of the whole system after reboot and will accept your modified two files.

Regards

Reply
Loading...
Vincent2
Mission Specialist
Mission Specialist
  • 168 Views

Re: Crack root password

0 Kudos
Reply
Loading...
Join the discussion
You must log in to join this conversation.