How to Disable Root Login in Ubuntu

It is better to disable root user login since allowing root user login is a major security concern in Linux system. You can use root login after logging in as another user.

1. Edit sshd_config file.

sudo pico /etc/ssh/sshd_config

2. Search PermitRootLogin directive in that file and change PermitRootLogin to no. Example:

# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes