By default, Ubuntu has a root password set as a hash. Sometimes, you can make a mistake, for example, remove your account from the group that allowed to use sudo. In a such cases, it's useful to have an access to the root user itself.
To set root password manually we should type in the shell:
sudo passwd