How to change the root password in Ubuntu

As default Ubuntu has no password set for the root user. To gain root access you have to type in your own user password. This is the password you set for the first user while installing Ubuntu.

To manually set a password for the root user, type in the following in the shell:
sudo passwd

After that you are asked to type in the new root password twice. Finally, your root user has its own password.

Not entirely correct

By default the root user is setup with a random hash during the install of Ubuntu. Having no password for root is a serious security issue of which the Ubuntu security team would NEVER allow.

See https://help.ubuntu.com/community/RootSudo for more detail.

Ubuntu is also setup initially with the first user having the right to become root through SUDO by being a member of the Admin group. Subsequent users that need root privileges simply need to be added to this group.

It is advisable to NEVER change the root password from it's default hash for many reasons. If you need persistent root access simply use sudo -i.

You're entirely incorrect.

"It is advisable to NEVER change the root password from it's default hash for many reasons. If you need persistent root access simply use sudo -i."

For those reading this, the above statement is a total load of crap. There's absolutely nothing wrong with changing the root password. The only danger is in forgetting the password, but you're not *that* stupid, right?

Unintentional Consequences

Even the article you point to concedes there are reasons and times when full access to root login is necessary. It even provides examples of when root login is needed and the command to relock the login after enabling.

Other means such as gksu access under nautilus or others like sudo -i have unintended limits and consequences. While applying myself diligently to workarounds might (or might not) eventually get the job done, "eventually" isn't good enough on a system I own, not Debian or Ubuntu. I am, after all, ultimately responsible for this machine and not them.

Simply use a secure password (16+ mixed characters and symbols in my case), do the job, and relock root when done.

When I first started using Ubuntu, it was still relatively easy to bypass sudo and enable root login. It has become increasingly difficult to do so with each new version. This is not a good thing in my opinion.