How can root login and password authentication for SSH be disabled? Core

The root user is enabled by default on most Linux servers, and hackers frequently attempt to get access to it by guessing its password. As a result, it’s a good idea to turn off the root account. First, make sure you have an admin user account so you can use the sudo special privileges access command to run root-level commands later. The Enable root login SSH can then be safely disabled.

$ vi /etc/ssh/sshd_config

PermitRootLogin no

Also, instead of using a password, you can use a safe mechanism like Enable root login SSH public-private key authentication.

$ vi /etc/ssh/sshd_config

PasswordAuthentication no

At Velan, our server support engineers can harden & manage your Linux server. If you are interested in our service, please fill the Quick connect form to get in touch with us.


Quick Connect With Us