M
M
Mark Rosenthal2016-09-21 13:43:51
linux
Mark Rosenthal, 2016-09-21 13:43:51

How to restrict access to the server via ssh to all but a few addresses?

Hey!
I have vps on centos. Recently I was in a frenzy for a week and went only yesterday. And what would you think? I see - over 700 login failure attempts for root. The logs showed some kind of botnet: there are too many addresses.
I thought to block access for everyone, except for me at home and at work, but my IP address at home changes according to this principle: 14.88.10.36/37/38/39 etc. Is there a way to make a whitelist using a mask?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2016-09-21
@font

Add to /etc/ssh/sshd_config
and let them at least crack, trying to guess the password. The password for <login> must be good. And best of all - key authentication.

S
SagePtr, 2016-09-21
@SagePtr

It is better to generally disable authorization by password, allow through the key. Then let them at least pick up, there will be no sense.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question