Please ensure Javascript is enabled for purposes of website accessibility knowledgebase.co.il - מדריכים - קטגוריה - Linux - Ubuntu - כיצד להתקין fail2ban ב-Ubuntu
אתם צופים ב: כיצד להתקין fail2ban ב-Ubuntu

כיצד להתקין fail2ban ב-Ubuntu

במדריך זה נלמד איך להתקין fail2ban ב-Ubuntu.


הקלידו את הפקודה הבאה כדי להתקין fail2ban:

sudo apt install fail2ban

אשרו את ההתקנה בעזרת בחירה ב-Y במהלך ההתקנה:

Do you want to continue? [Y/n]

פלט מלא:

root@knowledgebase:~# apt install fail2ban
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  python3-pyinotify whois
Suggested packages:
  mailx monit sqlite3 python-pyinotify-doc
The following NEW packages will be installed:
  fail2ban python3-pyinotify whois
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 473 kB of archives.
After this operation, 2,486 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirror.il.kamatera.com/ubuntu jammy/universe amd64 fail2ban all 0.11.2-6 [394 kB]
Get:2 http://mirror.il.kamatera.com/ubuntu jammy/main amd64 python3-pyinotify all 0.9.6-1.3 [24.8 kB]
Get:3 http://mirror.il.kamatera.com/ubuntu jammy/main amd64 whois amd64 5.5.13 [53.4 kB]
Fetched 473 kB in 0s (4,191 kB/s)
Selecting previously unselected package fail2ban.
(Reading database ... 108956 files and directories currently installed.)
Preparing to unpack .../fail2ban_0.11.2-6_all.deb ...
Unpacking fail2ban (0.11.2-6) ...
Selecting previously unselected package python3-pyinotify.
Preparing to unpack .../python3-pyinotify_0.9.6-1.3_all.deb ...
Unpacking python3-pyinotify (0.9.6-1.3) ...
Selecting previously unselected package whois.
Preparing to unpack .../whois_5.5.13_amd64.deb ...
Unpacking whois (5.5.13) ...
Setting up whois (5.5.13) ...
Setting up fail2ban (0.11.2-6) ...
Setting up python3-pyinotify (0.9.6-1.3) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@knowledgebase:~#

לאחר ההתקנה בדקו את הסטטוס:

fail2ban-client status
root@knowledgebase:~# fail2ban-client status
2022-11-12 05:58:57,513 fail2ban                [25522]: ERROR   Failed to access socket path: /var/run/fail2ban/fail2ban.sock. Is fail2ban running?
root@knowledgebase:~#

מכיוון שרק התקנו את ההרחבה, היא לא פעילה.

על מנת להפעיל אותה הקלידו:

fail2ban-client start

פלט מלא:

root@knowledgebase:~# fail2ban-client start
Server ready
root@knowledgebase:~#

במידה ואתם רוצים לעצור את התהליך:

root@knowledgebase:~# fail2ban-client stop
Shutdown successful
root@knowledgebase:~#

כדי לאתחל את התהליך:

fail2ban-client reload

פלט מלא:

root@knowledgebase:~# fail2ban-client reload
OK
root@knowledgebase:~#

בדיקה שהשרת פעיל:

fail2ban-client ping

פלט מלא:

root@knowledgebase:~# fail2ban-client ping
Server replied: pong
root@knowledgebase:~#

 

עליכם להתחבר על מנת להגיב בעמוד זה.