Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

yesterday i fail to login to my server because of bad password three times. Than no one from my IP can log to the system.

how to unlock it and how to set up rule like that? and other rule like if someone fail to login x time than lock that account.

ps : my server running with centos OS.

share|improve this question
    
are you using fail2ban ? –  Sirex Mar 31 '11 at 13:01
    
You describe two different scenarios in the above question: that three bad attempts lock further login attempts from the source IP, and that three bad attempts lock further login attempts to that account. Which do you want to do? Plus, are we talking ssh logins only, or are you looking for a more generally-valid technique? –  MadHatter Mar 31 '11 at 13:02
    
yes. its ssh login –  Jeg Bagus Mar 31 '11 at 13:06

1 Answer 1

up vote 1 down vote accepted

Login to your CentOS Server from Different ISP IP:

Flush all current rules in IPTables:

iptables -F

Then, install CSF:

yum -y install perl-libwww-perl && \
wget http://www.configserver.com/free/csf.tgz && \
tar -xzf csf.tgz && \
cd csf && \
sh install.sh

Then open /etc/csf/csf.conf

Change the value of TESTING to 0 from 1

So it should be like this:

TESTING = "0"

Then confirm the value of LF_DAEMON with 1

So it should be like this:

LF_DAEMON = "1"

Then change the value of LF_SSHD [Enable login failure detection of sshd connections]

Then,

/etc/init.d/csf restart
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.