CSF SSH Command Line Commands (CSF Cheat Sheet)

CSF SSH Command Line Commands (CSF Cheat Sheet)



CommandDescriptionExample
csf -eEnable CSFroot@server[~]#csf -e
csf -xDisable CSFroot@server[~]#csf -x
csf -sStart the firewall rulesroot@server[~]#csf -s
csf -fFlush/Stop firewall rules (note: lfd may restart csf)
root@server[~]#csf -f
csf -rRestart the firewall rulesroot@server[~]#csf -r
csf -a [IP.add.re.ss] [Optional comment]Allow an IP and add to /etc/csf/csf.allow
root@server[~]#csf -a 187.33.3.3 Home IP Address
csf -td [IP.add.re.ss] [Optional comment]Place an IP on the temporary deny list in /var/lib/csf/csf.tempbanroot@server[~]#csf -td 55.55.55.55 Odd traffic patterns
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 -tfFlush all IPs from the temporary IP entries
root@server[~]#csf -tf
csf -d [IP.add.re.ss] [Optional comment]Deny an IP and add to /etc/csf/csf.denyroot@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.denyroot@server[~]#csf -dr 66.192.23.1
csf -dfRemove and unblock all entries in /etc/csf/csf.denyroot@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 comments root@server[~]#csf -t