Forgetting the root password on your Ubuntu system can significantly hinder your ability to perform essential administrative tasks. However, thereβs no need to worry. Ubuntu Linux provides a relatively straightforward process to reset the root password, ensuring you can regain full access to your system. This guide walks you through the necessary steps to reset your root password, helping you to restore your administrative capabilities without much hassle.
Software Requirements and Linux Command Line Conventions
Category
Requirements, Conventions or Software Version Used
System
Ubuntu Linux (any recent version)
Software
No specific software required
Other
Physical or console access to the machine
Conventions
# β requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ β requires given linux commands to be executed as a regular non-privileged user
Resetting the Root Password
To regain access to your system as the root user, follow these steps:
Access the GRUB Menu: Restart your system. As it begins to reboot, press and hold the Shift key (for systems with BIOS) or the Esc key (for systems with UEFI), to bring up the GRUB menu. This menu allows you to select different boot options.
This is your first step towards resetting the root password, as it allows you to modify boot parameters.
π Access the GRUB Menu Access the GRUB Menu
Edit GRUB Menu Options: Use the arrow keys to navigate to the Ubuntu menu item you normally use to boot your system. Press the e key to edit the boot parameters for this entry. Look for a line that includes the parameters ro quiet splash. These control how Ubuntu boots.
π Edit GRUB Menu Options Edit GRUB Menu Options
Modify Boot Parameters: Replace ro quiet splash and any trailing strings with rw init=/bin/bash. This modification tells the system to boot into a bash shell with read-write permissions.
π Modify Boot Parameters Modify Boot Parameters
After making these changes, press F10. Your system will now boot directly into a root bash shell.
Reboot Your System: After resetting the password, reboot your system by running:
# exec /sbin/init
This command will start your system normally, allowing you to log in with the new root password.
Conclusion
Resetting the root password on Ubuntu Linux is a straightforward process that can be performed in a few minutes. By accessing the GRUB menu and modifying the boot parameters, you can quickly regain access to your system with a new root password. Remember, having access to the root account provides complete control over the system, so itβs crucial to keep your password secure and to follow best practices for system administration.