{"id":5390,"date":"2026-05-15T01:01:34","date_gmt":"2026-05-14T22:01:34","guid":{"rendered":"https:\/\/hostingdunyam.com.tr\/blog\/?p=5390"},"modified":"2026-05-15T01:03:08","modified_gmt":"2026-05-14T22:03:08","slug":"fail2ban-nedir","status":"publish","type":"post","link":"https:\/\/hostingdunyam.com.tr\/blog\/fail2ban-nedir","title":{"rendered":"Fail2Ban Nedir?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Fail2Ban, Linux sunucularda ba\u015far\u0131s\u0131z giri\u015f denemelerini izleyen ve belirli bir e\u015fi\u011fi a\u015fan IP adreslerini otomatik olarak engelleyen a\u00e7\u0131k kaynakl\u0131 bir g\u00fcvenlik arac\u0131d\u0131r. \u00d6zellikle SSH, FTP ve web panellerini hedef alan brute-force sald\u0131r\u0131lar\u0131na kar\u015f\u0131 etkili bir ilk savunma katman\u0131 olu\u015fturur.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Fail2Ban Nas\u0131l \u00c7al\u0131\u015f\u0131r?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Fail2Ban&#8217;\u0131n \u00e7al\u0131\u015fma mant\u0131\u011f\u0131 \u00fc\u00e7 temel kavram \u00fczerine kuruludur.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Jail (Hapishane):<\/b><span style=\"font-weight: 400;\"> Belirli bir servis i\u00e7in izleme kurallar\u0131n\u0131n b\u00fct\u00fcn\u00fcn\u00fc tan\u0131mlar. Hangi log dosyas\u0131n\u0131n izlenece\u011fini, ka\u00e7 ba\u015far\u0131s\u0131z denemeden sonra ban uygulanaca\u011f\u0131n\u0131 ve ban s\u00fcresini belirtir.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Filter (Filtre):<\/b><span style=\"font-weight: 400;\"> Log dosyalar\u0131ndan ba\u015far\u0131s\u0131z giri\u015f denemelerini yakalamak i\u00e7in kullan\u0131lan regex kal\u0131plar\u0131d\u0131r. SSH, FTP, Postfix gibi pop\u00fcler servisler i\u00e7in haz\u0131r filtrelerle birlikte gelir.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Action (Eylem):<\/b><span style=\"font-weight: 400;\"> Bir IP ban e\u015fi\u011fini a\u015ft\u0131\u011f\u0131nda Fail2Ban devreye girer ve iptables, firewalld veya nftables arac\u0131l\u0131\u011f\u0131yla o IP&#8217;ye gelen ba\u011flant\u0131lar\u0131 engeller. Ban s\u00fcresi doldu\u011funda engel otomatik olarak kalkar.<\/span><\/li>\n<\/ol>\n<h2><span style=\"font-weight: 400;\">Fail2Ban Hangi Servisleri Koruyabilir?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Fail2Ban yaln\u0131zca SSH i\u00e7in de\u011fil, log dosyas\u0131 \u00fcreten hemen her servis i\u00e7in kullan\u0131labilir. Haz\u0131r filtrelerle desteklenen ba\u015fl\u0131ca servisler: SSH\/SFTP, Apache, Nginx, Postfix, Dovecot, ProFTPD, vsftpd, MySQL ve cPanel\/Plesk gibi kontrol panelleri.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Fail2Ban Kurulumu<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">Debian \/ Ubuntu<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span> <span style=\"font-weight: 400;\">apt<\/span><span style=\"font-weight: 400;\"> update<\/span><\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span> <span style=\"font-weight: 400;\">apt<\/span> <span style=\"font-weight: 400;\">install<\/span><span style=\"font-weight: 400;\"> fail2ban -y<\/span><\/span><\/p>\n<h3><span style=\"font-weight: 400;\">RHEL \/ CentOS \/ AlmaLinux<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> dnf <\/span><span style=\"font-weight: 400;\">install<\/span><span style=\"font-weight: 400;\"> epel-release -y<\/span><\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> dnf <\/span><span style=\"font-weight: 400;\">install<\/span><span style=\"font-weight: 400;\"> fail2ban -y<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Kurulumun ard\u0131ndan servisi ba\u015flat\u0131n:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> systemctl <\/span><span style=\"font-weight: 400; color: #ff9900;\">enable<\/span><span style=\"font-weight: 400;\"> fail2ban<\/span><\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> systemctl start fail2ban<\/span><\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Temel Yap\u0131land\u0131rma<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Ana yap\u0131land\u0131rma dosyas\u0131 <\/span><span style=\"font-weight: 400;\">\/etc\/fail2ban\/jail.conf<\/span><span style=\"font-weight: 400;\">&#8216;tur. Ancak bu dosyay\u0131 do\u011frudan d\u00fczenlemek \u00f6nerilmez; g\u00fcncellemelerle \u00fczerine yaz\u0131labilir. Bunun yerine <\/span><span style=\"font-weight: 400;\">jail.local<\/span><span style=\"font-weight: 400;\"> dosyas\u0131 olu\u015fturun:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span> <span style=\"font-weight: 400;\">cp<\/span><span style=\"font-weight: 400;\"> \/etc\/fail2ban\/jail.conf \/etc\/fail2ban\/jail.local<\/span><\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span> <span style=\"font-weight: 400;\">nano<\/span><span style=\"font-weight: 400;\"> \/etc\/fail2ban\/jail.local<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Temel ayarlar:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">ini<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><span style=\"font-weight: 400;\">[<\/span><span style=\"font-weight: 400;\">DEFAULT<\/span><span style=\"font-weight: 400;\">]<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">bantime<\/span><span style=\"font-weight: 400;\">\u00a0 <\/span><span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">1h \u00a0 \u00a0 \u00a0 # Ban s\u00fcresi<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">findtime<\/span> <span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">10m\u00a0 \u00a0 \u00a0 # Deneme sayac\u0131n\u0131n s\u0131f\u0131rlanma s\u00fcresi<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">maxretry<\/span> <span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">5\u00a0 \u00a0 \u00a0 \u00a0 # Maksimum ba\u015far\u0131s\u0131z deneme say\u0131s\u0131<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">ignoreip<\/span> <span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">127.0.0.1\u00a0 # Asla banlanmayacak IP&#8217;ler<\/span><\/p>\n<p><span style=\"font-weight: 400;\">SSH i\u00e7in jail etkinle\u015ftirme:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">ini<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><span style=\"font-weight: 400;\">[<\/span><span style=\"font-weight: 400;\">sshd<\/span><span style=\"font-weight: 400;\">]<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">enabled<\/span><span style=\"font-weight: 400;\">\u00a0 <\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400; color: #00ff00;\"> true<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">port<\/span><span style=\"font-weight: 400;\"> \u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">ssh<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">filter<\/span><span style=\"font-weight: 400;\"> \u00a0 <\/span><span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">sshd<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><span style=\"font-weight: 400;\">logpath<\/span><span style=\"font-weight: 400;\">\u00a0 <\/span><\/span><span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">\/var\/log\/auth.log<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #ff0000;\">maxretry<\/span> <span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400; color: #00ff00;\">3<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Y\u00f6netim Komutlar\u0131<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Aktif jailleri listele:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> fail2ban-client status<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">SSH jail durumunu g\u00f6r\u00fcnt\u00fcle:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> fail2ban-client status sshd<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Bir IP&#8217;yi manuel olarak banla:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> fail2ban-client <\/span><span style=\"font-weight: 400;\">set<\/span><span style=\"font-weight: 400;\"> sshd banip <\/span><span style=\"font-weight: 400;\">1.2<\/span><span style=\"font-weight: 400;\">.3.4<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Banl\u0131 bir IP&#8217;yi serbest b\u0131rak:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span><span style=\"font-weight: 400;\"> fail2ban-client <\/span><span style=\"font-weight: 400;\">set<\/span><span style=\"font-weight: 400;\"> sshd unbanip <\/span><span style=\"font-weight: 400;\">1.2<\/span><span style=\"font-weight: 400;\">.3.4<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Canl\u0131 log takibi:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bash<\/span><\/p>\n<p><span style=\"color: #3366ff;\"><span style=\"font-weight: 400;\">sudo<\/span> <span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"> -f \/var\/log\/fail2ban.log<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fail2Ban, Linux sunucularda ba\u015far\u0131s\u0131z giri\u015f denemelerini izleyen ve belirli bir e\u015fi\u011fi a\u015fan IP adreslerini otomatik olarak engelleyen a\u00e7\u0131k kaynakl\u0131 bir g\u00fcvenlik arac\u0131d\u0131r. \u00d6zellikle SSH, FTP ve web panellerini hedef alan brute-force sald\u0131r\u0131lar\u0131na kar\u015f\u0131 etkili bir ilk savunma katman\u0131 olu\u015fturur. Fail2Ban Nas\u0131l \u00c7al\u0131\u015f\u0131r? Fail2Ban&#8217;\u0131n \u00e7al\u0131\u015fma mant\u0131\u011f\u0131 \u00fc\u00e7 temel kavram \u00fczerine kuruludur. Jail (Hapishane): Belirli bir servis [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5391,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5390","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-genel"],"_links":{"self":[{"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/posts\/5390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/comments?post=5390"}],"version-history":[{"count":1,"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/posts\/5390\/revisions"}],"predecessor-version":[{"id":5392,"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/posts\/5390\/revisions\/5392"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/media\/5391"}],"wp:attachment":[{"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/media?parent=5390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/categories?post=5390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostingdunyam.com.tr\/blog\/wp-json\/wp\/v2\/tags?post=5390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}