Whitelist an IP address in your server via SSH

One day, one of my blog readers can’t access my site. I wondered why and how come she can’t access it but I can. I also asked other readers, and they can. If this happens to you, just like what happened to me, maybe that specific user was blacklisted by your host.

In order for him or her to access your site again, you need to whitelist his or her IP. So the first thing that you should do is ask his IP address, then whitelist it in your server. To white list an IP address, you need to type the following command via SSH:
csf -a IP /etc/init.d/csf restart

Just replace the IP with the actual IP address. For example you want to white list 1.1.1.1, just type the command
csf -a 1.1.1.1 /etc/init.d/csf restart

To see the white listed IPs you could use the command,
grep IP /etc/csf/csf.allow

I think this is not applicable to all server. I’m using CentOS 5.0 with suPHP as my PHP handler. If your server configuration is different, ask you host first if your not familiar with SSH commands.

Do you love this article and you want to receive more interesting posts from Bryan Veloso? Why not subscribe to this blog via e-mail? It's easy! Just enter your e-mail address below and confirm your subscription by clicking the activation link that will be sent to your e-mail! Get your free subscription now!

Enter your email address:

This entry was posted in Geekery and tagged , , , , . Bookmark the permalink.

One Response to Whitelist an IP address in your server via SSH

  1. success ladder says:

    I really like your blog. Very good posts! Please continue posting such awesome cnotent.

Leave a Reply

Your email address will not be published. Required fields are marked *