How to reset root password in RHEL/CentOS Linux v6.x
A common scenario for a Linux administrator is ” the root password missing”. If that happens, you need to reset it. The only way to do that is by booting in the minimal mode (Single User Mode) , which allows you to log in without entering a password. To do so, following this post you’ll easily reset the forgotten root password in Red Hat, CentOS and Fedora Linux distros. There are multiple ways to reset the root password but this is the easiest and quick step to reset the forgotten root password using the single user mode.
Entering into the Single User mode to change the root password. To enter single user mode first reboot the server
Step 1: Go to Selected VM ware and select the option “Restarted Guest”. ( or ) (Re)start your computer. When the GRUB menu shows, select the first line in the menu and press e .
Step 2: Once restarted the server , on system boot, press “e” when GRUB bootloader menu is shown. Distrab the normal Booting process press “e” button, after we get the output of GRUB bootloader page of Kernel list if you have multiple, Select the appropriate Boot menu by using arrow key,
Step 4: Here type “1” and “Enter” , Here 1 for entering into the single user mode then press Enter to accept the changes.
Step 5: After getting this below output. Now can press “b” for boot and after system boots, we get single user mode access.
Step 6: here we can check SELinux mode ,because if SELinux enforcing mode it won’t take any changes of the configuration files. so, we can change the SELinux enforcing to disabled mode here. if it is in enforcing mode Go to SELinux configuration file” vi /etc/SELinux/config” ,then change it to disabled mode.
Conclusion: Editing the GRUB bootloader file is one of the riskiest tasks, so make sure doing properly as the settings what you need. While working with GRUB , you need to know a bit about kernel boot arguments.
There are many of them, and most of them you’ll never use, but it is good to know where you can find them. man pages you’ll find all the information about GRUB(Grand Unified Boot Loader).
If you find this post is helpful, or you may have some corrections, comments or query about it please feel free to contact us through below comment box