Posted: . At: 9:50 PM. This was 7 years ago. Post ID: 8175
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to login as root on Ubuntu. Enable the root account.

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.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.