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.


Comments

One response to “Whitelist an IP address in your server via SSH”

  1. success ladder Avatar
    success ladder

    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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.