LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-03-2010, 09:01 AM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
how do rate limited IPTABLEs treat a screen session on ssh after disconnection


Take this scenario If I have rate limited the connections to 4.(i.e if you attempt 4th connection you wont be able to login for some time.)
If in a minute I get disconnected 3 times
while I was already logged in on the server with a screen session,
will I be able to login or I need to keep quite for a minute?
Quote:
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name DEFAULT --rsource -j DROP
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name DEFAULT --rsource

Last edited by tkmsr; 11-03-2010 at 09:09 AM.
 
Old 11-03-2010, 06:20 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I think your '--set' line will need to be located before your '--update' line, it's probably not working now correct ?
 
Old 11-03-2010, 11:39 PM   #3
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Hmmm. Ok.
 
Old 11-04-2010, 06:03 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
The settings "--seconds 60 --hitcount 4" means that if the connection is the 4th or greater in a 60 second period from the same client it will be dropped

cheers
 
Old 11-05-2010, 01:12 AM   #5
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Ya I understand that.As you had suggested above to swap the rules I found rate limiting no longer worked.
How do you define the connection to be fourth connection can I some how maintain session in IPTABLES.
 
Old 11-05-2010, 06:42 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Thats what the 'recent' module does...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XDMCP Remote access session restore after disconnection soldonz Linux - Newbie 1 04-18-2005 03:20 PM
Limited to 60hz Refresh Rate pjpeter Debian 10 09-25-2004 01:57 PM
IPTABLES Forward ssh session wkuk Linux - Security 2 05-21-2004 07:41 AM
Telnet/SSH screen stops responding after a while but the session is still active alllle Linux - Networking 4 05-04-2004 12:52 PM
Disconnection problem using ssh basbosco Linux - Security 2 11-17-2003 05:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration