• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

fail2ban-client Command Examples in Linux

by Deepika

fail2ban-client is a command-line tool for configuring and controlling a fail2ban server. fail2ban is an intrusion prevention software that monitors log files for suspicious activity and bans IP addresses that show malicious behavior. This tool allows you to interact with the fail2ban server, to configure the server, check its status, and manage the banned IP addresses.

fail2ban-client Command Examples

1. Retrieve current status of the jail service:

# fail2ban-client status jail

2. Remove the specified IP from the jail service’s ban list:

# fail2ban-client set jail unbanip ip

3. Verify fail2ban server is alive:

# fail2ban-client ping

4. To check the status of all active jails, you can use the command:

# fail2ban-client status

5. To ban an IP address from a specific jail, you can use the command:

# fail2ban-client set jailname banip IP_ADDRESS

6. To unban an IP address from a specific jail, you can use the command:

# fail2ban-client set jailname unbanip IP_ADDRESS

7. To set the ban time for a jail, you can use the command:

# fail2ban-client set jailname bantime BAN_TIME

8. To set the find time for a jail, you can use the command:

# fail2ban-client set jailname findtime FIND_TIME

9. To reload the configuration of all jails, you can use the command:

# fail2ban-client reload

It’s important to note that jailname in the examples above should be replaced with the actual name of the jail that you want to manage. Also, the IP_ADDRESS and time values should be replaced with the actual values.

Filed Under: Linux

Some more articles you might also be interested in …

  1. Mutt, Mail and Telnet – Send mails from linux command line or terminal
  2. chcon: command not found
  3. nmcli Command Examples in Linux
  4. boltctl Command Examples in Linux
  5. shred: command not found
  6. a2disconf: command not found
  7. ldd: command not found
  8. journalctl: command not found
  9. How to Check if any of the RPM files were tampered with
  10. CentOS / RHEL : Configure yum automatic updates with yum-cron service

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright