How to deny access to SSH?

Just discovered the journal feature in Linux server... I saw a bunch of connections per second from different IP trying to log in but the password is wrong. I would like to restrict access only for one IP. But on the server is a game server and I don't know how to do it correctly, because they can block access to players
April 19th 20 at 12:16
5 answers
April 19th 20 at 12:18
Solution
1) move ssh to a different port
2) configure authorization on a key
3) install fail2ban
4) configure iptables ( beginners not recommended)
clause 4 will allow you to leave open only the game ports and ssh access and ssh protect p. 1-3
Interesting!
I understand that the car receives several requests per second, and thus reduces its performance. If I understand correctly, doing the steps you recommended, I will increase the car performance? - Hayley commented on April 19th 20 at 12:21
only the last - Efren_Lindgren13 commented on April 19th 20 at 12:24
@Hayley, to increase is to add, but You already have a ceiling. :)
for fun, change the port and view the load statistics for the network interface and the processor BEFORE and AFTER. While the port scan that has changed is time. - Declan75 commented on April 19th 20 at 12:27
@Hayley, queries, ssh is not vidosic on instagram. they are not great, for quickly obryvayutsya and the download is not much to say. a few queries per second IMHO garbage.
by following these steps you will increase zasedenosti system, and not get a Trojan with the miner. that's really decreased in numbers proizvoditelnosti the machine. - Clinton commented on April 19th 20 at 12:30
@Clinton, that's right, but still the machine is wasting resources on checking the correctness of the password, and so 3 times for each ip. Actually quite expensive, considering that the machine isn't powerful, only 4 cores(4GB RAM), still on top of the server costs. Would like that in the car, none on the left connect their resources. It seems that using iptables this can be configured - Hayley commented on April 19th 20 at 12:33
@Hayley, check password 3 times in a second is garbage, and not the consumption of resources. And 4 cores with 4 GB of memory is not weak, on the Internet overdoping of virtuallock much "weaker". - norma.Jast commented on April 19th 20 at 12:36
@Hayley, verify password = hash computation + comparison numbers. but I think you refuse from passwords to ssh. because it is a security hole the size of a receptionist :)
key verification is similar. a little bit longer we can.
poke your finger into the sky and say (with a large margin) the million other bars percent (if percent is ancient and no hardware md5) for CPU to 2GHz (and now much more) this is 2 thousandths of a second. it is a little
a thread of pycho script devour and more on an empty place - Clinton commented on April 19th 20 at 12:39
April 19th 20 at 12:20
Thought about that too - Hayley commented on April 19th 20 at 12:23
@Hayley, and that "thinking"something? this is the literal answer to your question - Efren_Lindgren13 commented on April 19th 20 at 12:26
But to do this I would tstal only if there is a remote console.
So, if change IP you can connect to the server. - Efren_Lindgren13 commented on April 19th 20 at 12:29
April 19th 20 at 12:22
Configure the connection only by key. All pickers passwords immediately break off
https://netpoint-dc.com/blog/nastrojka-autentifika...
But it will not forbid access to the server at all, that will not be able to connect even players? - Hayley commented on April 19th 20 at 12:25
@Hayley, This instruction limits connections only to ssh.
The game server I think on a different port. Pile up can add these scanners to the blacklist.

Read the article here
https://vps.ua/wiki/configuring-fail2ban/#a-4-4 - madge.Li commented on April 19th 20 at 12:28
they still break off.
the question is not whether to break off so that the logs do not litter - Efren_Lindgren13 commented on April 19th 20 at 12:31
@Efren_Lindgren13,
Easy way
LogLevel None

More fancy
man logd

search exclude events - madge.Li commented on April 19th 20 at 12:34
@madge.Li, Dada, and helps bronchitis a handkerchief. - Efren_Lindgren13 commented on April 19th 20 at 12:37
@Efren_Lindgren13, you can not please everyone

https://www.ibm.com/support/pages/how-stop-sshd-ex...

#SyslogFacility AUTH
#LogLevel INFO


Change this to the following.


SyslogFacility AUTH
LogLevel QUIET
- madge.Li commented on April 19th 20 at 12:40
@Efren_Lindgren13, so in the SSH key and logs will not be sacerfice - no pereborshil won't pick up the key.
Figuring out what makes server for a failed authentication attempt is not considered. - nia.Monahan12 commented on April 19th 20 at 12:43
April 19th 20 at 12:24
April 19th 20 at 12:26
Port 22/1022 Vblock. As whether via the router or via iptables.

Find more questions by tags UbuntuSSHLinux