News:

SMF - Just Installed!

Main Menu

How to prevent root SSH login?

Started by Dipak Bhoi, November 12, 2014, 12:58:21 PM

Previous topic - Next topic

Dipak Bhoi

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 !!
MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.