How to Enable and Disable Root Login in Ubuntu 18.04
The default root password is not set in the Ubuntu Desktop and therefore you do not have the facility of logging in as root. This does not mean that the original root account does not exist in Ubuntu or cannot be fully accessed. Here we are given the ability to execute tasks with superuser privileges using the sudo command. practically Ubuntu developers have decided to disable root account by default. The root account which has given the password does not match the encrypted value, it can not directly login itself.
Note: The root account does not need to be enabled in the Ubuntu system because you do not call it root account for many activities in Ubuntu.
Follow The Below Steps to Enable and Disable Root Login in Ubuntu 18.04:
For instance, to get root privileges, the sudo command is used in the Ubuntu system. For this purpose or for another reason, you can act as a root in the Ubuntu terminal. Or you can enable or disable root account log in Ubuntu in the following ways.
How to Enable Root Login Account in Ubuntu 18.04?
To enable access to the root Login user account, enter the following command and enter your user password.
itsmarttricks@mangesh:~$ sudo -i [sudo] password for itsmarttricks: root@mangesh:~# ls root@mangesh:~# id uid=0(root) gid=0(root) groups=0(root)
Now you can confirm that by entering ‘whoami‘ command you can see that you have enabled Access to the root user account.
root@mangesh:~# whoami root
Also Read – How To Reset Forgotten Kali Linux Root Password.
How to Change Root Login Password in Ubuntu 18.04?
Now, to change the root password here, enter the following command.
itsmarttricks@mangesh:~$ sudo passwd root [sudo] password for itsmarttricks: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
How to Disable Root Login Access in Ubuntu 18.04?
If you want to disable root account login in your Ubuntu system then expire the password by entering the following command.
itsmarttricks@mangesh:~$ sudo passwd -l root passwd: password expiry information changed.
Also Read – Top Basic Linux Commands for Beginners.
That’s all, In this article, we have explained the How to Enable and Disable Root Login in Ubuntu 18.04. I hope you enjoy this article. If you like this article, then just share it. If you have any questions about this article, please comment.