If you forgot your root password on Linux…
Don’t worry! You can set a new one if you have sudo set up on your system.
See my post about setting up sudo on your linux box if you haven’t already…
sudo allows a regular user to perform single commands as root (or another user), this can be used to set a new password for root and is also safer than using su on it’s own for general admin tasks.
To set a new password for root::
[shady@localhost ~]$ sudo passwd
Password:
Changing password for user root.
New UNIX password:
Retype new UNIX password:
Password updated
[craig@localhost ~]$
Well done! Now you can be root again!
