How to Enable Root Login on Ubuntu 14.04

Ubuntu 14.04 is an old version of the Ubuntu operating system, but it is still in use in some environments. By default, the root account is disabled in Ubuntu for security reasons. However, in some cases, you may need to enable root login to perform administrative tasks.

In this guide, we will show you how to enable root login on Ubuntu 14.04.

Step 1: Switch to Root User

The first step is to switch to the root user by running the following command in your terminal:

sudo su

This command will prompt you to enter your password. Once you enter the password, you will be logged in as the root user.

Step 2: Set a Password for the Root User

Next, you need to set a password for the root user. Run the following command:

passwd root

You will be prompted to enter a new password for the root user. Enter the password and confirm it.

login as: rsuog
rsuog@192.168.0.114's password:
Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Sun Apr 27 23:49:57 MYT 2014

  System load:  0.15              Processes:           68
  Usage of /:   3.8% of 31.37GB   Users logged in:     0
  Memory usage: 3%                IP address for eth0: 192.168.0.114
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

4 packages can be updated.
1 update is a security update.

Last login: Sun Apr 27 23:49:57 2014
ehowstuff@ubuntu14:~$ sudo passwd root
[sudo] password for rsuog:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
rsuog@ubuntu14:~$

Step 3: Edit the SSH Configuration File

Now, you need to edit the SSH configuration file to enable root login over SSH. Run the following command:

sudo nano /etc/ssh/sshd_config

This command will open the sshd_config file in the nano text editor. Find the line that says:

PermitRootLogin without-password

Change it to:

PermitRootLogin yes

Save the changes and exit the editor by pressing Ctrl + X, then Y, and finally Enter.

See also  How to Uninstall Zabbix on Ubuntu

Step 4: Restart the SSH Service

Finally, you need to restart the SSH service to apply the changes. Run the following command:

sudo service ssh restart

Now, you can log out of your current session and log in as the root user using the password you set in step 2.

Commands Mentioned:

  • sudo su – Switch to root user
  • passwd root – Set a password for the root user
  • sudo nano /etc/ssh/sshd_config – Edit the SSH configuration file
  • sudo service ssh restart – Restart the SSH service
See also  How to Uninstall ISPConfig on Ubuntu

Conclusion

In this guide, we have shown you how to enable root login on Ubuntu 14.04. By following these steps, you can switch to the root user and perform administrative tasks that require root privileges. However, it is important to remember that enabling root login can be a security risk, and it is recommended to disable it again once you have finished your tasks. You can do this by editing the sshd_config file and changing PermitRootLogin yes back to PermitRootLogin without-password. We hope this guide has been helpful to you. If you have any comments or suggestions for improvements, please feel free to share them below.

Comments

2 Comments

Leave a Reply

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