You may have noticed that you can’t login to root account on Ubuntu, this is because root doesn’t actually have a password set.
Type the following command:
The following message will appear:
[sudo] password for [username]: [Type your user password and press return]
After that another message will appear, the following:
Type new UNIX password: [Type the root password you want]
Now the last thing you need to do, the following:
Retype new UNIX password: [Retype the root password you chosen before]