Resetting a Linux password is done in two ways, depending on the bootmanager you are using (LILO or GRUB). For both managers, I will provide all the necessary steps to change the password so you can gain access to the system’s root functions.
LILO : Boot into single-user mode
- Reboot the system and when you see the boot: prompt type: linux single and press enter and wait for the system to load
- When the system finished booting, you will be logged into single-mode with root administration rights
- Type passwd and enter your new password
Grub: Boot into single-user mode
- Reboot your system and when the OS selection comes up, quickly press E
- You will be taken to another screen where you will have to select kernel and then you need to press E again and type single after all the commands and hit Enter to save.
- From the main menu, press B and wait for the system to load.
- Once logged in type passwd and enter your new password.
Note: Also, to change the password for a specific user, type “passwd user” and enter new password for the user and upon normal log-in type the username and new password and you will have access to the system.