Skip to main content

Posts

Showing posts from March, 2021

How to reset/break root password in RHEL / CentOS 7 ?

Sometimes a user may forget the password for the root account in Linux, and this could lead to a big problem sometimes, how to overcome from this scenario. So here is what you can do in order to reset the root account.  The first thing which you can try is, if sudo user is added to your server, you should be able to reset the password for the root account using sudo user. Just login with sudo user and execute the following command. # sudo passwd root   Second, If sudo user is not added to the server then you need to follow the following steps. 1) reboot the server,  Interrupt booting the server by pressing any key, you will see the grub screen.  2)  Choose the kernel and edit it by pressing 'e' 3) Find the line which is being started with linux16 and append 'rd.break' at the end 4) After that press CTLR+x to boot the server into emergency mode  5) Now remount sysroot by using the following commands # mount -o remount,rw /sysroot # chroot /sysroot  6) N...