Some people say you won’t need to use the root account anymore in Ubuntu. That’s why Ubuntu doesn’t activate the root account for default installs. In my opinion they want to make Ubuntu more secure. Since Ubuntu is now user-friendly and not just for developers or other computer geeks, end-users or even a newbie can use Ubuntu. But not for me — I need the root account, because it’s more convenient for me to configure or do settings on an Ubuntu machine. Imagine if I don’t use the root account to configure an Ubuntu machine, I have to type ‘sudo’ every session to configure Ubuntu.
But sometimes you forget your root password — maybe you barely use it, or your admin is out and you have to replace him as administrator but he/she didn’t tell you the root password. Now what do you have to do? Re-install? I wouldn’t do that, because a re-install will create more work unless you think it’s really necessary and you know what you are doing.
You can recover/change your root password if you have the machine in front of you, meaning you own the machine. So if you are looking for how to hack someone’s server from the network, this article is not for you.
How to recover root password in Ubuntu:
- You need to reboot your Ubuntu
- When you reach the GRUB page, press ‘e’ (without quotes) — this command is to edit grub
- Edit one of your boot commands
- Add this command to the very end of that boot command: rw init=/bin/bash
- Press enter and boot your system; that command will make your Ubuntu boot with a passwordless root shell
- Then just change your password with the passwd username command. If it is root just type: passwd root
- Reboot your system
Now your root password has changed and you can use it. That’s it. Thanks for reading and have a nice day… oops, don’t forget to leave a comment lol. Thanks.
