Git Product home page Git Product logo

proxmox-8.0.3-security-fail2ban-ssh-and-ufw's Introduction

Fail2Ban Installation and Configuration on Proxmox 8

Installation

  1. Install Fail2Ban:

    sudo apt-get update
    sudo apt-get install fail2ban
  2. Install UFW (Uncomplicated Firewall):

    sudo apt-get install ufw
  3. Configure UFW:

    sudo ufw allow 8006
    sudo ufw allow 443
    sudo ufw allow 80
    sudo ufw allow 69 (Replace with your ssh port) 
    sudo ufw deny from any to any port 22
    sudo ufw enable

Configuration

  1. Create jail.local configuration file:

    Open the jail.local file for editing:

    sudo nano /etc/fail2ban/jail.local

    Add the following configuration for Proxmox:

    [proxmox]
    enabled = true
    port = https,http,8006
    filter = proxmox
    banaction = iptables
    backend   = systemd
    maxretry  = 5
    findtime  = 1d
    bantime   = 1d
    
    [sshd]
    enabled   = true
    filter    = sshd
    banaction = iptables
    backend   = systemd
    maxretry  = 3
    findtime  = 1d
    bantime   = 1d
  2. Create proxmox.conf filter file:

    Open the proxmox.conf file for editing:

    sudo nano /etc/fail2ban/filter.d/proxmox.conf

    Add the following configuration:

    [Definition]
    failregex = pvedaemon\[.*authentication (verification )?failure; rhost=<HOST> user=.* msg=.*
    ignoreregex =
  3. Restart Fail2Ban:

    sudo systemctl restart fail2ban

Usage

Fail2Ban is now configured to monitor the specified ports and log files for suspicious activity. If an IP address exceeds the defined threshold, it will be automatically banned for the specified duration.

UFW is configured to allow traffic on ports 8006, 443, 80, and 11797 while denying SSH access to root. Adjust the configuration parameters as needed for your specific requirements.

proxmox-8.0.3-security-fail2ban-ssh-and-ufw's People

Contributors

primemurcia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.