MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


Author Topic: How to prevent root SSH login?  (Read 2950 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipak Bhoi

  • MilesWeb Team Member
  • Full Member
  • ***
  • Posts: 208
  • Karma: +5/-0
    • View Profile
    • MilesWeb Internet Services
How to prevent root SSH login?
« 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 !!
MilesWeb.com
cPanel Hosting in India - cPanel Hosting in India.

Grab an SSL for your website and SAVE 20% now. Coupon Code SSLSAVE20.

MilesWeb Hosting Forum

How to prevent root SSH login?
« on: November 12, 2014, 12:58:21 PM »