Useful CSF SSH Command Line Commands (CSF Cheat Sheet)

This article covers some useful CSF SSH Command Line Commands in a “cheat sheet†format.

CommandDescriptionExample
csf -s Start the firewall rules root@server[~]#csf -s
csf -f Flush/Stop firewall rules (note: lfd may restart csf)
root@server[~]#csf -f
csf -r Restart the firewall rules root@server[~]#csf -r
csf -a [IP.add.re.ss] [comment] Allow an IP and add to /etc/csf/csf.allow
root@server[~]#csf -a 187.33.3.3 Home IP Address
csf -tr [IP.add.re.ss] Remove an IP from the temporary IP ban or allow list.
root@server[~]#csf -tr 66.192.23.1
csf -tf Flush all IPs from the temporary IP entries
root@server[~]#csf -tf
csf -d [IP.add.re.ss] [comment] Deny an IP and add to /etc/csf/csf.deny root@server[~]#csf -d 66.192.23.1 Blocked This Guy
csf -dr [IP.add.re.ss] Unblock an IP and remove from /etc/csf/csf.deny root@server[~]#csf -dr 66.192.23.1
csf -df Remove and unblock all entries in /etc/csf/csf.deny root@server[~]#csf -df
csf -g [IP.add.re.ss] Search the iptables and ip6tables rules for a match (e.g. IP, CIDR, Port Number) root@server[~]#csf -g 66.192.23.1
csf -t  Displays the current list of temporary allow and deny IP entries with their TTL and comment  root@server[~]#csf -t

Whitelisting an IP Address

In order to prevent specific IP from being blocked, even for a temporary deny, you need to list their IP address in the files csf.ignore and csf.allow. The first step is to enable IGNORE_ALLOW in csf.conf. The value for IGNORE_ALLOW will appear as “0″, you will need to adjust it to “1″ and restart csf and lfd.

This will allow lfd to reference csf.ignore. If you add an IP address to csf.ignore, the IP address will no longer be checked by lfd and failed login attempts will not trigger temporary denies.

  • 0 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

Connect using Putty to a Linux Server

This article covers how to connect using Putty to a Linux Server. 1. If you haven't already,...

How to Create a Full cPanel Backup through SSH

This article will guide you on how to create a full cPanel backup through SSH. Note: The syntax...

Useful cPanel Scripts

This article covers some useful scripts built into cPanel! cPanel Update /scripts/upcp  This...

How to Set up Auto Login to PHPMyAdmin

How to Set up Auto Login to PHPMyAdmin    This article covers how to setup Auto Login to...

Fix Webalizer not Updating Problem in cPanel

Fix the Webalizer not Updating Problem in WHM/cPanel The Webalizer is a fast, free web...