Managing IP Access on Your Cloud or Dedicated Server
Controlling access to your server is key to keeping it secure. Whitelisting, blacklisting, and unblocking IP addresses lets you manage who can connect to your server. With these tools, you can ensure only trusted users access your resources and block unwanted or malicious traffic. In this guide, we’ll show you how to do this using the command line and the WHM panel on Cloud or Dedicated servers.
- Why block, unblock, or whitelist IPs
- Block, Unblock, and Whitelist IPs using SSH (CSF)
- Block, Unblock, and Whitelist IPs using WHM
- Using cPHulk Brute Force Protection
Why block, unblock, or whitelist IPs
Whitelisting IPs
- Why: Allows trusted users or systems to connect freely to your server.
- When: Use it for known, secure users or systems (e.g., your office network, partners).
Blacklisting IPs
- Why: Blocks malicious users, bots, or unwanted traffic.
- When: Use it to stop brute-force attacks, spammers, or suspicious activity.
Unblocking IPs
- Why: Restores access for legitimate users who may have been mistakenly blocked.
- When: Use it if a user needs access but was accidentally blocked.
Block, Unblock, and Whitelist IPs using SSH (CSF)
CSF (ConfigServer Security & Firewall) is a powerful firewall tool for Linux servers that lets you manage IP access. It allows you to whitelist, blacklist, and unblock IPs, helping you secure your server and ensure trusted users have uninterrupted access.
Before starting, you’ll need to access your server via SSH (Secure Shell). See: How to Connect by SSH to the Server (Shell Access).
Use the following CSF commands (replace IPADDRESS with the actual IP):
| Action | Command |
| Verify IP block | csf -g IPADDRESS |
| Block IP address | csf -d IPADDRESS |
| Unblock IP address | csf -dr IPADDRESS |
| Whitelist IP address | csf -a IPADDRESS |
For more commands, see this list of essential CSF commands.
Tip: Learn more from these cPanel articles:
Block, Unblock, and Whitelist IPs using WHM
You can also manage IP addresses directly through the WHM panel. Use the ConfigServer Security & Firewall interface to quickly block, unblock, and whitelist IPs:
- Access your WHM panel.
- In the WHM dashboard, open ConfigServer Security & Firewall.
- Click csf.
- Use the available options to block, unblock, and whitelist IP addresses.
Tip: Helpful WHM resources:
Using cPHulk Brute Force Protection
While command-line IP management is important, cPHulk adds extra protection for cPanel servers. It automatically blocks IPs that attempt too many failed logins. Using cPHulk alongside manual IP management gives your server stronger, all-around security.
Key capabilities of cPHulk:
- Brute force protection: Blocks IPs after a set number of failed login attempts.
- Whitelist/blacklist management: Allow trusted IPs and deny malicious ones.
- Customizable thresholds: Set limits and block durations.
- Real-time email alerts: Get notified when an IP is blocked.
- Easy WHM management: Configure settings and view blocks in WHM.
See the official docs: cPHulk Brute Force Protection.
Tip: More cPHulk how-tos: