Tuesday, 2 December 2014

Disabling SSH login for root

Disabling SSH login for root
After you create a normal user, you can disable SSH logins for the root account. To do this, follow these steps:
Log in to the server as root using SSH.
Open the /etc/ssh/sshd_config file in your preferred text editor (nano, vi, etc.).
Locate the following line:
PermitRootLogin yes
Modify the line as follows:
PermitRootLogin no
Add the following line. Replace USERNAME with the name of the user you created in the previous procedure:
AllowUsers USERNAME

No comments:

Post a Comment