HOW TO ENABLE ROOT USER LOGIN (SUPERUSER LOGIN) IN UBUNTU 16.04
In this article we are going to learn How to enable root user login (Superuser Login) in Ubuntu 16.04. As we all know that root user is the supreme user of any Linux distribution operating system. Hence root user is also known as Superuser. By login using root user (Superuser) we can do any extreme level of changes in Linux operating system.
By default in Ubuntu Linux operating system the root user comes in disabled state for security reason and you can’t login using root. The reason behind this is there is risk of any by mistake changes of any important files or configurations, someone can misuse of this feature and so on. Hence in Ubuntu to do any administrative changes or important changes you can use sudo command. For example to install or update package you can use the below command.
sudo apt-get update
Ubuntu by default don’t allows us for root user login but there is a way by which we can enable it and use for testing and R & D purpose.
Warning : Using root login is a bad idea and We also don’t recommend to use root user login. This article is only for Learning, Testing and R & D purpose and for internal use only. We don’t recommend you to use this tutorial for any production server or in Live server.
Follow the below steps to Enable root user login (Superuser Login) in Ubuntu 16.04
Step : 1
First you have to set the password for root user. To do so you can use the below command.
elinuxbook@ubuntu:~$ sudo passwd root # Set Password for root User [sudo] password for elinuxbook: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
Step : 2
As you can see above we have successfully set the password for root user. Now we have to edit an file called 50-ubuntu.conf to enable root user login for Ubuntu 16.04. Hence edit the file and add this syntax greeter-show-manual-login=true at end of the file.
Refer the below Step to do the same.
elinuxbook@ubuntu:~$ sudo nano /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf [Seat:*] user-session=ubuntu greeter-show-manual-login=true
Also Read :
- HOW TO RESET FORGOTTEN LINUX ROOT PASSWORD ON REDHAT/CENTOS 4/5/6
- HOW TO RESET FORGOTTEN ROOT PASSWORD IN RHEL/CENTOS 7
- HOW TO PROTECT GRUB2 BOOTLOADER WITH PASSWORD IN RHEL/CENTOS 7
Now we are ready to login the Ubuntu operating system using root user. So after above changes just reboot the operating system and login using root user and it’s password.
To confirm the logged in username you can use the below command.
root@ubuntu:~# whoami # Check the logged in User root
When you first time login the operating system using root user you might get the below error.
So to solve this issue, after login using root user just edit the profile file of the root and enter the below lines at end of the file.
if `tty -s`; then
Refer the sample output below.
root@ubuntu:~# nano .profile # Edit the profile file # ~/.profile: executed by Bourne-compatible login shells. if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi if `tty -s`; then mesg n fi
After above changes again logout and login the operating system and it’s Done.
This is how we can enable root user login (Superuser Login) in Ubuntu 16.04. If you found this article useful then Like us, Share this post on your preferred Social media, Subscribe our Newsletter OR if you have something to say then feel free to comment on the comment box below.