What's new

Welcome to Ruzgar.com

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask question

Ask questions and get answers from our community

Answer

Answer questions and become an expert on your topic

Contact us

Contact the site administrator directly.

Groups

Just like Facebook join them and enjoy.

Centos DirectAdmin SSH Root Port Change

ruzgar

Administrator
Staff member
Joined
Oct 3, 2021
Messages
37
Reaction score
0
Points
6
When you connect to Centos

You can see a message like that:

Last failed login: Sat Feb 22 12:19:18 +03 2020 from xx.xxxx.xx.xx on ssh:notty
There were 39452 failed login attempts since the last successful login.

In other words, there were 39452 SSH attempts in 12 hours.

If this continues like this, there is a very high probability that they will find the real password one day.

You can take a simple precaution for this. You can change the standard SSH port (22) to a different port.

To find out your SSH Port

Code:
netstat -ntpl | grep ssh

You can use code.

First, login with root from SSH:

Open the SSH management file with the command

Code:
nano /etc/ssh/sshd_config

# Go to Port 22
delete the # sign
Delete 22 and type in the port you want to use.

Close with Ctrl or Command X, it will ask to save, type y and press enter.

Restart the ssh service by typing

Code:
service sshd restart

You can see if the port has changed with the grep ssh command.

Code:
netstat -ntpl | grep ssh

ATTENTION, THE ERRORS YOU MAY MAKE IN THIS SECTION WILL BLOCK YOU TO CONNECT TO YOUR SERVER. PLEASE BE VERY CAREFUL DURING INTERVENTION!
 
shape1
shape2
shape3
shape4
shape5
shape6
Top