Ubuntu Root Default Password? Setting Root Password on Ubuntu 16.04 | 18.04

For students and new users learning how to use Ubuntu Linux, one question to remember is there are no default passwords for the root account on Ubuntu systems…

By default, a root account is created automatically when you install Ubuntu, but the account has no passwords assigned… The security feature with that is accounts with no passwords are automatically disabled… and can’t be use to logon to the system…

So, no password on root account automatically disables it and prevents anyone from using it to gain access to the system..

Also, you don’t need the root account to run administrative commands or make changes to your system… The first account you create is automatically associated with administrative rights…

You can run administrative commands simply by using the sudo command…For example, if you want to run commands that are only used by the system administrator or root, you simply use the sudo before the commands…

sudo chmod -R 777 confidential.txt

The commands above change the permissions for the confidential.txt file so everyone has access to it… assuming the file is owned by another account or the root user or protected..

Setting a Root Password

Setting a root password on Ubuntu systems brings risk and you should probably avoid it… If you want to run commands set aside for the root user, you should use the sudo command…

However, if you insist to set a password for the root user and use it to logon, even with all the risks, then run the commands below:

sudo passwd root

You’ll be prompted to create a new password for the root account… Create a confirm the password and the root account should have a password assign to it…

Logging in As Root

Although a password is assigned to the root account, you still won’t use it to logon to the system… In order to logon with the root account, you must also unlock it…

Since it had an empty password, it was automatically locked… you must unlock before using it to sign on… To do that, run the commnads below…

sudo passwd -u root

That should do it..

Now you should be able to sign in with the root account with full root access without the need to type sudo before running commands…

You may also like the post below:

Setup Magento 2 with Composer on Ubuntu 16.04 / 18.04 and Nginx, MariaDB and PHP 7.1-FPM Support

Leave a Reply

Your email address will not be published. Required fields are marked *

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