If you’re a Linux user, there’s a chance you’ll forget your password at some point, especially if you have a large number of passwords to remember.
The good news is that it’s relatively easy to reset your password in Linux, and in this article we show you four ways you can do it.
The methods we cover are:
Using sudo to change the root password.
Using the GRUB bootloader and changing the root password in single user mode.
Using the Systemd Debug mode and changing the root password in debug mode.
Using a Live ISO and changing the root password.
It’s worth noting that these methods will work on most Linux systems, but some, such as Ubuntu, disable the root user by default. In those cases, you can access the root shell by running sudo -s.