How to enable and disable SSH root login on Ubuntu 16.04

Ubuntu Tutorial – There are several ways to secure our Linux server. One thing that we can do it first is to disable root login via SSH. By disabling this account, we can use normal user with sudo privileges to do administrative tasks. On this tutorial, I am going to show you how to disable and enable root login on Ubuntu 16.04 Server. By default, root login via SSH is disabled on Ubuntu 16.04 Server.

enable root login ubuntu.png

How to enable root login via SSH on Ubuntu 16.04

You may don’t want to do this but I could be useful for us to know how to enable root login via SSH on Ubuntu 16.04.

sudo nano /etc/ssh/sshd_config

Now find the following line

PermitRootLogin prohibit-password

To enable root login, change it to this

PermitRootLogin yes

Close and save the file and then restart sshd.

sudo systemctl restart sshd

Now you can login via SSH using root. To disable the root login, simple change it back to the original one.

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*