Articles & Code Snippets

CSF SSH Command Line Commands

ConfigServer Firewall (CSF) SSH command line commands in a "cheat sheet" format.

Command Description Example
csf -e Enable CSF csf -e
csf -x Disable CSF csf -x
csf -s Start the firewall rules csf -s
csf -f Flush/Stop firewall rules (note: lfd may restart csf)
csf -f
csf -r Restart the firewall rules csf -r
csf -a [] [Optional comment] Allow an IP and add to /etc/csf/csf.allow
csf -a Home IP Address
csf -td [] [Optional comment] Place an IP on the temporary deny list in /var/lib/csf/csf.tempban csf -td Odd traffic patterns
csf -tr [] Remove an IP from the temporary IP ban or allow list.
csf -tr
csf -tf Flush all IPs from the temporary IP entries
csf -tf
csf -d [] [Optional comment] Deny an IP and add to /etc/csf/csf.deny csf -d Blocked This Guy
csf -dr [] Unblock an IP and remove from /etc/csf/csf.deny csf -dr
csf -df Remove and unblock all entries in /etc/csf/csf.deny csf -df
csf -g [] Search the iptables and ip6tables rules for a match (e.g. IP, CIDR, Port Number) csf -g
csf -t  Displays the current list of temporary allow and deny IP entries with their TTL and comments  csf -t

Source: web