Ielaušanās novēršana ar fail2ban
Saturs
Uzstādīšana
Uzstāda fail2ban servisu ar komandu:
sudo su
apt install fail2banKā root lietotājs izveido lokālās kopijas iestatījumu failiem, kuros var veikt labojumus:
cd /etc/fail2ban/
cp jail.conf jail.local
cp fail2ban.conf fail2ban.localVeic nepieciešamos pielāgojumus jail.local, piemēram:
ignoreip = 127.0.0.1/8 ::1 172.31.4.49/32 52.58.11.108/32 2a05:d014:4ec:de01:ee0f:1bf4:6331:608d/128 94.100.8.131/32 85.254.75.0/24
bantime = 5m
bantime.increment = true
bantime.rndtime = 5m
bantime.maxtime = 100d
bantime.factor = 2
bantime.formula = ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)
bantime.overalljails = true
findtime = 1dVeic nepieciešamos pielāgojumus fail2ban.local, piemēram:
dbpurgeage = 30d
Pārbaude
Kopējā statusa pārbaude:
fail2ban-client statusKonkrēta "cietuma" pārbaude:
fail2ban-client status sshd"Cietuma" ignorētās adreses:
fail2ban-client get sshd ignoreip
Adreses izņemšana no liegto saraksta:
fail2ban-client set apache unbanip 111.111.111.111
VNC un RDP iestatījumi
Lejuplādē un attiecīgās /etc/fail2ban/ vietās ievieto failus
Lai fail2ban serviss palaistos, ir nepcieciešami iestatījumos norādītie faili!
Ja nepieciešams, skatīt Regexp for fail2ban (for xrdp.log)
Papildu informācija
- Using Fail2ban to Secure Your Server
- Example of fail2ban configuration to ban servers spamming my postfix server?
- How to use Fail2ban for securing Apache web server from 404 attacks?
- How To Protect an Apache Server with Fail2Ban on Ubuntu 14.04
- How to configure fail2ban to protect Apache HTTP server
Tags
Serveris
Linux
Created by Valdis Vītoliņš on 2026-04-01 13:31
Last modified by Valdis Vītoliņš on 2026-04-01 17:21
Created by Valdis Vītoliņš on 2026-04-01 13:31
Last modified by Valdis Vītoliņš on 2026-04-01 17:21


