• 1-888-289-2246
  • 24x7x365 Presence

Disabling the default SSH port and direct root user login on the Linux machine


Many times, a hacker tries to login directly via root access on the Linux machine (which enables root login) and can get access by cracking the password with the default SSH port.

Today we’ll discuss how to change the default SSH port and to disable direct root login on the remote Linux machine via SSH. This is all done with the help of SSH (Secure Shell).

Follow the steps below:-

Step 1: Login onto the Linux machine.
Step 2: Open the SSHD configuration file at the location below:-

vim /etc/ssh/sshd_config

Step 3: Find the commented settings below and do the changes as below:-

——————–
#Port 22

Port 9899

#PermitRootLogin yes

PermitRootLogin no
——————–

Step 4: Save the file and restart the SSHD service using the command below:-

service sshd restart

and that’s it. You’ve secured your Linux machine/server by using SSH on its default port and with the root user.

After this, make sure you’ve created another normal user account with which you can use SSH on the Linux machine and after that take shell of the root using the su – command and with the root password.

This will make your system more secure.

]]>


Leave a Reply

Your email address will not be published. Required fields are marked *