Block IP for whole server through WHM or CPanel?

Vaulter

Registered
Jan 6, 2005
4
0
151
Hey guys! I am partners with a reseller I know and I cannot get access to the site unless I use a proxy or use a different IP. I dont know why, but I looked through the cpanel ip deny manager and didnt see my IP in there. Does anyone know how this can be? Thanks, Travis.
 

Vaulter

Registered
Jan 6, 2005
4
0
151
Yes I have root access. (SSH I hope is what you mean?) As for the firewall, that might be because I dont see any other way it would be blocked. It was working earlier in the day then it was blocked... :/ If I use a proxy, I can get on.. If not I cant access any site on the server, nor an ip of the server. Im puzzled.
 

santame

Active Member
Nov 15, 2003
30
0
156
I need to block an IP from accessing our server. How do I do this please using SSH?

Thank you for your time.
 

goodgbb

Well-Known Member
Aug 15, 2005
71
0
156
Thailand
user.forum said:
If APF is installed, you can run: apf -d <your IP address> - It will unblock you.
Do not use -d to your ip address. It's the command to add ip to deny list.

-s|--start ......................... load firewall policies
-r|--restart ....................... flush & load firewall
-f|--flush|--stop .................. flush firewall
-l|--list .......................... list chain rules
-st|--status ....................... firewall status
-a HOST CMT|--allow HOST COMMENT ... add host (IP/FQDN) to allow_hosts.rules and immediately load new rule into firewall
-d HOST CMT|--deny HOST COMMENT .... add host (IP/FQDN) to deny_hosts.rules and immediately load new rule into firewall
 

goodgbb

Well-Known Member
Aug 15, 2005
71
0
156
Thailand
Vaulter said:
Hey guys! I am partners with a reseller I know and I cannot get access to the site unless I use a proxy or use a different IP. I dont know why, but I looked through the cpanel ip deny manager and didnt see my IP in there. Does anyone know how this can be? Thanks, Travis.
If you're using APF. Make sure that your ip don't have in deny list. Type..
#vi /etc/apf/deny_hosts.rules
If you've see your ip in the list just delete that line then press esc button and type ":wq" then enter

Then allow your ip address by the following command.
#apf -a <your ip address to allow access>

Then restart your APF by the following command
#apf -r

done!
 
Last edited: