The cPFence command-line interface (CLI) provides a comprehensive set of commands for managing and securing your server. This guide organizes all available commands into categories for easier navigation and efficient usage. Use these commands to configure, monitor, and maintain your server's security settings with precision.
General Options
- Check Status:
Displays information about current running modules and license status.cpfence --status
- Show Statistics:
View protection statistics and server details.cpfence --show-stats
- Set Notification Email:
Set or update the email address in cPFence configuration.cpfence --set-email [email protected]
- Enable or Disable SMTP Notifications:
cpfence --enable-cpfence-smtp
Manages SMTP settings for cPFence notifications only.cpfence --disable-cpfence-smtp
- Enable or Disable Global SMTP:
cpfence --enable-global-smtp
Manages server-wide SMTP relay when Enhance Smart Host isn’t working for you.cpfence --disable-global-smtp
- Restart Services:
Restarts all services and modules to apply settings.cpfence --restart
Protection Control
- Enable All Protections:
Activate all default protections.cpfence --enable-all
- Disable All Protections:
Deactivate all protections.cpfence --disable-all
IPDB / DDoS Protection Module
- Enable or Disable IPDB:
cpfence --enable-ipdb
Manage the cPFence IPDB module for enhanced security.cpfence --disable-ipdb
- Restart IPDB:
Restart the IPDB service.cpfence --restart-ipdb
- Enable or Disable DDoS Protection:
cpfence --enable-DDos
Manage cPFence DDoS protection.cpfence --disable-DDos
WordPress Security and Maintenance Tools
- Enable or Disable WordPress Integrity Check:
cpfence --enable-integrity-check
Manage WordPress Integrity Check for enhanced security.cpfence --disable-integrity-check
- Enable or Disable Automatic Quarantine for Wordpress sites :
cpfence --enable-auto-file-action
Control automatic handling of unexpected files.cpfence --disable-auto-file-action
- Set Integrity Check Frequency:
Choose how often to run the integrity check.cpfence --set-check-frequency [daily|hourly]
- Generate WordPress Sites List:
Lists all WordPress sites on the server along with account owners.cpfence --generate-wp-sites-list
- Perform Vulnerability Scan:
Scan WordPress sites for vulnerabilities.cpfence --vuln-scan
- Export Vulnerability Scan Results:
Export the scan results in CSV format.cpfence --vuln-export
WAF Management
- Enable WAF:
Enable the OLS/LS latest cPFence WAF.cpfence --enable-ols-waf
- Disable WAF:
Disable the OLS/LS cPFence WAF.cpfence --disable-ols-waf
- Disable a Specific WAF Rule by ID:
Disable a specific WAF rule server-wide by its ID.cpfence --disable-waf-rule RULE-ID
- Enable a Specific WAF Rule by ID:
Re-enable a currently disabled WAF rule server-wide by its ID.cpfence --enable-waf-rule RULE-ID
- Disable WAF for a Specific Domain:
Disable WAF entirely for a specific domain.cpfence --disable-waf-domain DOMAIN
- Enable WAF for a Specific Domain:
Re-enable WAF for a previously disabled domain.cpfence --enable-waf-domain DOMAIN
- Disable WAF Rules for a Specific Domain by ID:
Disable one or more specific WAF rules for a domain by providing the rule IDs.cpfence --disable-waf-domain-byid DOMAIN ID-LIST
- Enable WAF Rules for a Specific Domain by ID:
Re-enable specific WAF rules for a domain that were previously disabled.cpfence --enable-waf-domain-byid DOMAIN
Malware Protection Settings
- Enable Real-Time Protection:
Enable Malware Real-Time Protection for continuous scanning.cpfence --enable-MRTP
- Disable Real-Time Protection:
Disable Malware Real-Time Protection.cpfence --disable-MRTP
- Enable Proactive Scanning:
Enable Proactive Scanning for fast detection. (recommended)cpfence --enable-proactive
- Disable Proactive Scanning:
Disable Proactive Scanning for reduced RAM usage.cpfence --disable-proactive
- Enable Auto Quarantine:
Automatically move infected files to the quarantine directory.cpfence --enable-quarantine
- Disable Auto Quarantine:
Turn off automatic quarantine. Review scan results manually.cpfence --disable-quarantine
- Enable Email Quarantine:
Quarantine suspicious emails with infected attachments or phishing links.cpfence --enable-email-quarantine
- Disable Email Quarantine:
Disable automatic quarantine for suspicious emails.cpfence --disable-email-quarantine
- Enable Spam Protection:
Enable advanced filtering to detect and quarantine spam emails.cpfence --enable-spam-protection
- Disable Spam Protection:
Disable spam filtering for email content.cpfence --disable-spam-protection
Scanning Options
- Run a Full Scan:
Perform a full scan on all files. This process may take 30 minutes up to several hours.cpfence --full-scan
- Run a Smart Scan:
Scan critical areas and commonly infected files for faster results.cpfence --smart-scan
- Run a Custom Scan:
Perform a custom scan on a specific path or directory.cpfence --custom-scan PATH
- Stop Active Scanning Jobs:
Stop all currently running scans, including Full, Smart, and Custom scans.cpfence --stop-scan
- Exclude a Path from Scans:
Add a path or directory to the exclusion list for all scanning jobs.cpfence --exclude-path PATH
- Remove a Path from Exclusions:
Remove a previously excluded path from the exclusion list.cpfence --del-exclude-path PATH
- Run a Custom Scan without Quarantine:
Run a custom scan without quarantine or exclusions. Example:cpf_scan /var/www
cpf_scan /var/www
.
- Run a Custom Scan and Move to Quarantine:
Perform a custom scan and move infected files to the quarantine directory.cpf_scan --move=/opt/cpfence/quarantined/ /var/www
cPFence Owl™ Monitoring Module
- Enable Owl Monitoring System:
Enable the cPFence Owl Monitoring system to track and analyze server activity. (recommended)cpfence --enable-owl
- Disable Owl Monitoring System:
Disable the cPFence Owl Monitoring system.cpfence --disable-owl
- Restart Owl Monitoring System:
Restart the cPFence Owl Monitoring system to refresh its operations.cpfence --restart-owl
Rootkit Scanner
- Enable Rootkit Scanner:
Turn on the Rootkit daily scanner to detect and protect against hidden threats. (recommended)cpfence --rootkit-on
- Disable Rootkit Scanner:
Turn off the Rootkit daily scanner.cpfence --rootkit-off
IP Management Commands
- Check the Current State of an IP:
Check if an IP is whitelisted, blacklisted, or blocked and view related statistics. Example:cpfence --check-ip IP
cpfence --check-ip 192.168.1.1
.
- Add an IP to the Whitelist:
Whitelist an IP to allow it through server defenses. Example:cpfence --add-whitelist-ip IP
cpfence --add-whitelist-ip 192.168.1.1/23
.
- Remove an IP from the Whitelist:
Remove an IP from the whitelist. Example:cpfence --del-whitelist-ip IP
cpfence --del-whitelist-ip 192.168.1.1
.
- Add an IP to the Blacklist:
Blacklist an IP to block it from accessing your server. Example:cpfence --add-blacklist-ip IP
cpfence --add-blacklist-ip 192.168.1.1/24
.
- Remove an IP from the Blacklist:
Remove an IP from the blacklist. Example:cpfence --del-blacklist-ip IP
cpfence --del-blacklist-ip 192.168.1.1
.
- Bulk Add IPs to the Whitelist:
Add multiple IPs to the whitelist from a file or URL. Example:cpfence --bulk-whitelist-ip URL_OR_FILE
cpfence --bulk-whitelist-ip https://a.com/file.txt
.
- Bulk Add IPs to the Blacklist:
Add multiple IPs to the blacklist from a file or URL. Example:cpfence --bulk-blacklist-ip URL_OR_FILE
cpfence --bulk-blacklist-ip /path/to/file
.
- Bulk Remove IPs from the Whitelist:
Remove multiple IPs from the whitelist using a file or URL. Example:cpfence --bulk-del-wl-ip URL_OR_FILE
cpfence --bulk-del-wl-ip https://a.com/file.txt
.
- Bulk Remove IPs from the Blacklist:
Remove multiple IPs from the blacklist using a file or URL. Example:cpfence --bulk-del-bl-ip URL_OR_FILE
cpfence --bulk-del-bl-ip /path/to/file
.
Country Blacklisting / Whitelisting Module
- Add a Country to the Whitelist:
Allow traffic from a specific country. Example:cpfence --whitelist-country ISOCODE
cpfence --whitelist-country us
.
- Add a Country to the Blacklist:
Block traffic from a specific country. Example:cpfence --blacklist-country ISOCODE
cpfence --blacklist-country cn
.
- Remove a Country from the Whitelist:
Remove a country from the whitelist. Example:cpfence --del-whitelist-country ISOCODE
cpfence --del-whitelist-country us
.
- Remove a Country from the Blacklist:
Remove a country from the blacklist. Example:cpfence --del-blacklist-country ISOCODE
cpfence --del-blacklist-country cn
.
Maintenance Options
- Update cPFence:
Update cPFence software and virus signatures to the latest version.cpfence --update
- Uninstall cPFence:
Uninstall the cPFence software completely from your server.cpfence --uninstall
- Display Installed Version:
Check the currently installed version of cPFence.cpfence --version
- Display Help Message:
Show the full list of available cPFence commands and their descriptions.cpfence --help
Need Further Assistance?
Visit our Knowledgebase or contact our support team for help.