Results 1 to 8 of 8
-
05-20-2013, 03:44 PM #1Web Hosting Master
- Join Date
- Oct 2010
- Posts
- 647
How to block an ip from accessing my vps ?
My host had some firewall installed not sure what it is, I guess its CSF. I'd returned today after a short trip to find out, there were at least 45 Hack Attempts were made by some user to get into my script Admin panel, with in 3 days. All the attempts were made by a single ip address. I'm not sure whether revealing the ip address on wht is according to WHT rules or not, so I've posted it over here.
I would like to know, is there a way I can block this ip from even accessing my VPS ? I'm pretty much a noob with Linux & SSH, so kindly do lemme know in simple steps how can I block this particular notorious user's ip.
-
05-20-2013, 03:54 PM #2Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
If you have a firewall such as CSF installed, there is an anti-bruteforce element (LFD) which should automatically pick up on this activity.
Here are some examples on how you can block an IP from SSH
CSF Firewall:
csf -d xx.xx.xx.xx
APF Firewall:
apf -d xx.xx.xx.xx
IPTables (If you have no firewall):
iptables -I INPUT -s xx.xx.xx.xx -j DROP
Then iptables-save >> /etc/sysconfig/iptables will ensure it survives a reboot. That assumes you are on RedHat/CentOS, the configuration location may be slightly different on other distro's.
-
05-20-2013, 03:55 PM #3Web Hosting Master
- Join Date
- Nov 2001
- Location
- Ashburn, VA
- Posts
- 1,207
If you are in fact using CSF, just do the following from the shell.
csf -d IPADDRESSAffordable web hosting, design, & domain registration services since 2001
www.serve-you.net
-
05-20-2013, 04:08 PM #4Web Hosting Master
- Join Date
- Oct 2010
- Posts
- 647
Thanks friends for the assistance
Is there a way I can find out which firewall I'm using by running any specific command ?
-
05-20-2013, 04:41 PM #5Web Hosting Master
- Join Date
- May 2012
- Location
- Linux World
- Posts
- 1,137
check the init scripts ls /etc/init.d/* and see if csf/apf is there or do a ps aux |egrep 'csf|apf' , or do a 'which csf; which apf'
Kevin Cheri : Senior Server Administrator / Freelancer : 13+ years Exp, reach me out for any help
Server Optimization Expert / Mysql Guru / Migration Specialist
Skype : lynxmaestro
Gmail : cheri.kevin@gmail.com
-
05-20-2013, 06:41 PM #6Temporarily Suspended
- Join Date
- May 2013
- Location
- India
- Posts
- 747
just type csf and click enter in the command prompt. If csf is installed you will get the list of options that you can use with csf. If not try apf and iptables will be there by default.
But I suggest you to get csf installed as you can use it from WHM also
-
05-21-2013, 11:54 AM #7Disabled
- Join Date
- Aug 2012
- Posts
- 3,105
Check in /etc folder also. If CSF is installed then there will be a folder like /etc/csf. Actually, CSF works on top of iptables, so it is a better idea to use CSF as a firewall and if you have cPanel/WHM installed then you will get an option of plugin of CSF which makes it easy to manage via WHM.
-
05-22-2013, 07:53 AM #8Web Hosting Master
- Join Date
- Oct 2010
- Posts
- 647
Thanks for your help friends CSF was disabled for some reason, I had to enable it & I've added the necessary ip to the block list
Really appreciate each & everyone of you, for ur time in helping me out
Similar Threads
-
how to block some IPs from accessing my site?
By bhatmahesht in forum Hosting Security and TechnologyReplies: 11Last Post: 11-24-2012, 10:33 AM -
Challenge: Block all IP addresses except one from accessing server.
By StackHost in forum Hosting Security and TechnologyReplies: 1Last Post: 01-28-2007, 02:43 AM -
How to block countries from accessing my site
By superprogram in forum Hosting Security and TechnologyReplies: 7Last Post: 12-12-2004, 05:38 PM -
Block the whole country from accessing server
By Shin Asuka in forum Hosting Security and TechnologyReplies: 10Last Post: 11-20-2004, 04:54 AM -
How to block an IP from accessing the server?
By ymfm in forum Hosting Security and TechnologyReplies: 4Last Post: 05-11-2004, 05:58 PM