Jump to content

Ban IP address from viewing site


Square Wheels
 Share

Recommended Posts

To clarify, you can add that as a block in an .htaccess file, as was noted. The full block of code to add would be:

order allow,deny
deny from xxx.xxx.xxx.xxx
allow from all

where xxx.xxx.xxx.xxx is the actual IP Address you want to block. Additional "deny from" lines can be added after the first one, but before the last line, as so:

order allow,deny
deny from xxx.xxx.xxx.xxx
deny from xxx.xxx.xxx.xxx
deny from xxx.xxx.xxx.xxx
allow from all

The exact message they will see depends somewhat on the server, but generally they will get a "You don't have permission to access / on this server" or similar wording.

Link to comment
Share on other sites

If your on a VPS / Dedi and have root access and csf firewall then in ssh type

csf -d [xxx.xxx.xxx.xxx] [reason text]	

Example to add IP to /etc/csf/csf.deny	

root@onrahost[~]#csf -d 122.34.5.66 Reason for block

You will then need to restart CSF to make the changes take effect

csf -r

Example to restart csf	

root@onrahost[~]#csf -r

 

Link to comment
Share on other sites

Thanks all.

Not sure if I will be doing this yet.  It's actually for one of my best members.  He feels he needs an electronic vacation so I banned him from the site (per request), but he still visits the site and emails some of his friends.  Before I offered to him the ability to completely ban him, I wanted to see if it could be done.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...