In this post we’ll discuss, how to recover lost password in Linux (CentOS/Red Hat)
=> At first, we Reboot the system by pressing Ctr+Alt+del
=> After that, we need to edit the default boot loader entry
=> After that, press ‘e’ to edit the current entry
=> Cursor navigate to the line that starts with ‘linux16’.
=> After that, press ‘End’ button to move the cursor to the end of the line.
=> Find, ‘rd.break’ to the end of the line.
=> Finally, Press ‘Ctrl+x’ to boot using the modified config.
switch_root:/# mount -o remount,rw /sysroot
switch_root:/# chroot /sysroot
sh-4.2# passwd [press enter]
: ******* (123456)
: ******* (123456)
sh-4.2# touch /.autorelabel
sh-4.2# exit
switch_root:/# exit
=> Wait for 2 Min
=>Now, login with new password
[root@desktopX ~]# passwd ; press EnterSometimes it is needed to recover lost password. So in this type of situation this type of tutorial is needed. I can share my experience about this. I was so busy in my work for one month, so i can’t be able to log in my Linux OS. Generally i remember the password. Also I keep my password writing. But at that time i can’t be able to remember the password. The password i enteres, showing wrong password. I was also unable to find the paper i wrote the password. So then i need to recover lost password.
Hope that this post will help to if you forget your password. If you have any kinds of question or suggestion, please comment below. Thanks you and have a good day.
Leave a Reply