/go/fail2ban: fail2ban from the Command Line

/go/fail2ban installs Fail2ban if it isn't already, then writes four jail configuration files — SSH, FTP, SMTP, and Dovecot — and restarts the service. Each jail reuses the server's IP whitelist (see white) as its ignoreip list. The call is appended to /var/log/go/fail2ban.log. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Install (if needed) and configure the standard jails
/go/fail2ban

Options

None. The whitelist used for ignoreip comes from /var/go/etc/white, managed with white, not from a command-line option here.

Examples

# Set up or refresh the standard jails
/go/fail2ban

# Unban everyone without touching the jail configuration
/go/fail2ban clear

# Check who is currently banned
sudo fail2ban-client status sshd

Output

The command prints nothing of its own. fail2ban-client and the package manager print their own progress and errors.

# Check jail status afterwards
sudo fail2ban-client status
sudo fail2ban-client status sshd

See the full reference at /go/fail2ban and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *