E
E
Eugene M2019-03-17 06:45:13
CentOS
Eugene M, 2019-03-17 06:45:13

How to restrict SSH access on centos7?

I need an option for the number of connection attempts, because someone tried to connect to my server 20 times.
5c8dc2a7a7c81621605896.jpeg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
U
uaVPS, 2019-03-17
@uaVPS

By default, the ssh service is open in CentOS
First, we allow access for the desired subnet 1.2.3.0/24 (substitute your value)
Next, apply the changes
We look that everything went well and the rule was added
And only now we remove the general ssh rule from the list of allowed
Apply the changes again
Now the kulzkakers will not bother you, but if you want to open the ssh port to the outside, then only fail2ban will save you

V
vanoc, 2019-03-18
@Zoro

fail2ban, denyhosts

C
CityCat4, 2019-03-18
@CityCat4

man sshd_config
Reading about
LoginGraceTime
MaxAuthTries
MaxSessions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question