Custom Search

Ubuntu server login as root

As you already know, Ubuntu does not prompt for root password during installation process. Ubuntu just asked to create a normal user account and to provide password for the user. What about the root account and root password? Perhaps it use the same password as the user account we created? Let's try:



We got login incorrect. No. That's not the Ubuntu root password. Then how do we login as root into Ubuntu server?

All Linux distributions created root account during installation. In Ubuntu server case, the root account has been disable for safety purpose. You know, root can do anything in the system. Like the agents in the Matrix, you know. So, Ubuntu has reasons not to let user login into the system using root. But if you really need to login with root anyway, then here is how I do it:

Firstly, login with the normal user account we created during the installation. Then issue this command: sudo passwd root. See example below:

luzar@ubuntu:~$ sudo passwd root
[sudo] password for luzar:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
luzar@ubuntu:~$


The sudo command give us root privilege to change the password for user root. When we press enter, Ubuntu server will ask for user password. This is the normal user account password, not the root password. So, enter the user password. Then, Ubuntu will ask for the new UNIX password. Now this is our root password. So enter whatever you choose to be your root password. You are going to be asked to enter the root password again for confirmation. If Ubuntu confirm the password update with this:
passwd: password updated successfully, then the root password setup is successful.

We can logout and test our root account like the example below:



That's it. Please remember that root is the most powerful user in Linux system. Login as root only for administration purposes only. I would recommend login as a normal user and use sudo command. If you are not comfortable with sudo, then switch to root with su command. You can switch back to normal user with exit command after finished your administration tasks.

No comments:

Post a Comment

Please keep comment relevant and strictly no spam will be tolerated. Thank you.