MilesWeb Hosting Forum

Web Hosting Technical Support => How To's => Topic started by: Dipak Bhoi on November 12, 2014, 12:58:21 PM

Title: How to prevent root SSH login?
Post by: Dipak Bhoi on November 12, 2014, 12:58:21 PM
Hello Guys,

This post will help you to secure the ssh login. To prevent root SSH login, login to SSH and create an account.

Quote#useradd username

Quote#passwd username

After setting a password for the new account then assign Wheel group to user so only that user can switch to root user account.

Quote#usermod -G wheel username

Then disable root SSH login:

Quote#vim /etc/ssh/sshd_config

Find for the line #PermitRootLogin yes and replace yes with no and remove the hash from line in early.

Then restart the SSH service:

Quote#service sshd restart

Enjoy !!