How to unlock the root account on an Ubuntu machine
The root account on an Ubuntu machine is normally disabled. This is how to enable the root account to use this Linux account like a traditional Linux system.
Firstly, enable the root account by setting a new password.
ubuntu ~ $ sudo passwd root Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
Then you may login to the root account as normal.
ubuntu ~ $ su Password: root@ubuntu:/home/ubuntu#
That is how easy this is.
The way to lock the root account again is to execute this command.
ubuntu ~ $ sudo passwd -l root passwd: password expiry information changed.
That will lock the root account again.
Another way to get root prompt access is with sudo.
ubuntu ~ $ sudo su -
This will drop you at a root prompt.