Howto change ROOT password in Ubuntu (All variants)
When you install fresh Ubuntu, you can login via normal user account which do not have root/admin rights. So when you try to change to super user root , you just can’t Login to root because you don’t have the root Password. Although you can use sudo command (which is also a kind of failsafe to prevent accidently execution of unwanted mistakes or commands) to execute any task that requires root access, but still if you are doing some administrative related work, its a bit annoying to use sudo before every command.
In Ubuntu , root ID is created without predefined password, it does not have a password, but it does not have an empty password either , ggrrrrrrr
To assign/change root password , use the following command at terminal
sudo passwd root
It will ask you to enter current user password, enter it and then it will ask you to enter new root password two times, then it will change the root password , then simply log off and login with root id or use
It will ask you to enter root password, simply enter password that you set in above step.
… OR …
Alternate method is following …
Use below command to switch to shell world
It will ask you the default current user password, just enter your password and press Enter and you will be presented with # sign.
Now enter this command to change the root password.
Now enter your new password for user root twice and now you can login to root by using your newly created password by using . . .
Howto Recover User Forgotten Password [ UBUNTU 12.x ]
1. Reboot your ubuntu computer
2. Hold shift during boot to start GRUB menu
3. Highlight your image and press ‘e’ to edit
4. Find the line starting with linux and append init=/bin/bash at the end of that line
5. Press ctrl-x to boot.
6. Type in passwd username
7. Set your password.
8. Type in reboot