Enable Root Login in Ubuntu Server

Root login is disabled in Ubuntu servers by default. If you want to enable root login for your Ubuntu servers follow the steps below.

First login to your server’s SSH client as admin user, then ‘sudo’ then when it ask for root password, type that then press enter, now follow below steps. If you have ‘nano‘ editor installed on your server then you can ignore first 2 commands.

apt-get update

apt-get install nano

nano /etc/ssh/sshd_config

Now by pressing down arrow find “PermitRootLogin without-password” and change that to “PermitRootLogin yes” without quote and press ctrl+x to save that file, then pres ‘y‘ then press enter.  Now restart SSHD with the below command.

service ssh restart

Now you can able to login as root in your Ubuntu server. Please note that for security reason you should keep your SSH port disabled as default, use ‘sudo’ command to get root privilege when you need that.