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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. Determining disk usage in Linux using “du” command
  2. couchdb: Command-line interface for Apache CouchDB database server
  3. geth: The go-ethereum command-line interface
  4. CentOS / RHEL 7 : How to change the verbosity of debug logs during booting
  5. lsblk Command Examples in Linux
  6. mkinitrd: command not found
  7. lshal Command Examples in Linux
  8. CentOS / RHEL : Exclusion with Yum For Kernel Updates
  9. udisksctl Command Examples in Linux
  10. blastn Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright