Skip to content
Tutorial emka
Menu
  • Home
  • Debian Linux
  • Ubuntu Linux
  • Red Hat Linux
Menu

Cara Setting Fail2Ban SSH Server di Ubuntu 24.04/Ubuntu 24.10/Linux Mint

Posted on October 23, 2024

Keamanan server Ubuntu 24.04 Anda sangat penting, terutama jika server tersebut terhubung ke internet. Salah satu ancaman umum adalah upaya akses tidak sah, khususnya melalui SSH. Fail2ban adalah alat yang ampuh yang dapat membantu melindungi server Anda dengan secara otomatis memblokir aktivitas yang mencurigakan.

Langkah 1: Memperbarui Sistem Anda

Sebelum menginstal apa pun, sebaiknya perbarui sistem Anda untuk memastikan semua paket Anda sudah diperbarui. Buka terminal Anda dengan menekan Ctrl + Alt + T dan masukkan perintah berikut:

      sudo apt update && sudo apt upgrade -y
    

Perintah ini akan memperbarui daftar paket Anda dan menginstal versi terbaru dari paket yang terinstal pada sistem Anda.

      sudo apt install fail2ban
    

Perintah ini menginstal Fail2ban pada sistem Anda. Setelah instalasi selesai, Fail2ban akan siap untuk dikonfigurasi./etc/fail2ban/jail.confjail.local

      sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
    

Sekarang, buka file untuk diedit:

      sudo nano /etc/fail2ban/jail.local
    

Langkah 4: Mengamankan SSH dengan Fail2ban

Untuk melindungi layanan SSH Anda, cari bagian di file . Berikut ini adalah contoh sederhana tentang cara mengonfigurasinya:

[sshd]
enabled  = true
port     = ssh
logpath  = /var/log/auth.log
maxretry = 3
    

  • enabled = true

  • port = ssh

  • logpath = /var/log/auth.log

  • maxretry = 3

  • Langkah 5: Merestart Fail2ban

    Setelah membuat perubahan, restart Fail2ban untuk menerapkan pengaturan baru:

          sudo systemctl restart fail2ban
        

    Anda dapat memeriksa status Fail2ban untuk memastikan bahwa ia berjalan dengan benar:

          sudo systemctl status fail2ban
        

    Langkah 6: Memantau Fail2ban

    Untuk melihat alamat IP mana yang saat ini diblokir, gunakan perintah berikut:

          sudo fail2ban-client status sshd
        

    Perintah ini menunjukkan jumlah IP yang saat ini diblokir dan informasi terkait lainnya.

    Recent Posts

    • How to build a high-performance private photo cloud with Immich and TrueNAS SCALE
    • How to Build an Endgame Local AI Agent Setup Using an 8-Node NVIDIA Cluster with 1TB Memory
    • How to Master Windows Event Logs to Level Up Your Cybersecurity Investigations and SOC Career
    • How to Build Ultra-Resilient Databases with Amazon Aurora Global Database and RDS Proxy for Maximum Uptime and Performance
    • How to Build Real-Time Personalization Systems Using AWS Agentic AI to Make Every User Feel Special
    • How to Transform Your Windows 11 Interface into a Sleek and Modern Aesthetic Masterpiece
    • How to Understand Google’s New TPU 8 Series for Massive AI Training and Inference
    • How to Level Up Your PC Gaming Experience with the New Valve Steam Controller and Its Advanced Features
    • Is it Time to Replace Nano? Discover Fresh, the Terminal Text Editor You Actually Want to Use
    • How to Design a Services Like Google Ads
    • How to Fix 0x800ccc0b Outlook Error: Step-by-Step Guide for Beginners
    • How to Fix NVIDIA App Error on Windows 11: Simple Guide
    • How to Fix Excel Formula Errors: Quick Fixes for #NAME
    • How to Clear Copilot Memory in Windows 11 Step by Step
    • How to Show Battery Percentage on Windows 11
    • How to Fix VMSp Service Failed to Start on Windows 10/11
    • How to Fix Taskbar Icon Order in Windows 11/10
    • How to Disable Personalized Ads in Copilot on Windows 11
    • What is the Microsoft Teams Error “We Couldn’t Connect the Call” Error?
    • Why Does the VirtualBox System Service Terminate Unexpectedly? Here is the Full Definition
    • Why is Your Laptop Touchpad Overheating? Here are the Causes and Fixes
    • How to Disable All AI Features in Chrome Using Windows 11 Registry
    • How to Avoid Problematic Windows Updates: A Guide to System Stability
    • What is Microsoft Visual C++ Redistributable and How to Fix Common Errors?
    • What is the 99% Deletion Bug? Understanding and Fixing Windows 11 File Errors
    • Apa itu Pengertian Frontier Market di Dunia Saham?
    • Apa itu Krnl Executor Roblox Mei 2026?
    • Inilah Cara Entry Nilai Rapor SPMBJ Jatim 2026 dan Berkas yang Dipersiapkan
    • Inilah 15 SMA Swasta Terbaik di Semarang Menurut Hasil SNBP 2026
    • Inilah Rekomendasi Motor Matic Paling Nyaman Buat Jarak Jauh 2026
    • How to Automate Your Entire SEO Strategy Using a Swarm of 100 Free AI Agents Working in Parallel
    • How to create professional presentations easily using NotebookLM’s AI power for school projects and beyond
    • How to Master SEO Automation with Google Gemini 3.1 Flash-Lite in Google AI Studio
    • How to create viral AI video ads and complete brand assets using the Claude and Higgsfield MCP integration
    • How to Transform Your Mac Into a Supercharged AI Assistant with Perplexity Personal Computer
    • Apa itu Spear-Phishing via npm? Ini Pengertian dan Cara Kerjanya yang Makin Licin
    • Apa Itu Predator Spyware? Ini Pengertian dan Kontroversi Penghapusan Sanksinya
    • Mengenal Apa itu TONESHELL: Backdoor Berbahaya dari Kelompok Mustang Panda
    • Siapa itu Kelompok Hacker Silver Fox?
    • Apa itu CVE-2025-52691 SmarterMail? Celah Keamanan Paling Berbahaya Tahun 2025
    ©2026 Tutorial emka | Design: Newspaperly WordPress Theme