LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-22-2012, 12:14 AM   #1
dman777
Member
 
Registered: Dec 2010
Distribution: Gentoo
Posts: 232

Rep: Reputation: 8
sshd_config MaxAuthTries -when does it reset?


When a ipaddress reaches this threshold, what/when does it reset for that ipaddress?

Quote:
MaxAuthTries
Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. The default is 6.
 
Old 08-22-2012, 12:27 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

from that text in the man page it looks like it resets for each *connection* (nothing to do with the ipaddress). Are you observing some sort of different behaviour?

Evo2.
 
Old 08-22-2012, 01:19 AM   #3
dman777
Member
 
Registered: Dec 2010
Distribution: Gentoo
Posts: 232

Original Poster
Rep: Reputation: 8
I would think per a connection would be per a ipddress, if not what would define the "per a connection" criteria(since there is no authentication at this point the daemon does not keep track of the user but the connection)? Yes, the behavior I have is once I reach the threshold, I can no longer log in ever for that user. The work around was to vnc into the host, raise the threshold, login successfully to reset the threshold for that connection. If I didn't do that would that connection be banned from logging in forever?

Last edited by dman777; 08-22-2012 at 01:26 AM.
 
Old 08-22-2012, 01:46 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

Quote:
Originally Posted by dman777 View Post
I would think per a connection would be per a ipddress, if not what would define the "per a connection" criteria(since there is no authentication at this point the daemon does not keep track of the user but the connection)?
A connection to the daemon. Ie from the time that authentication starts on a single ssh instance (to an sshd) and then exits. (but I've been unable to confirm this).

If you read the sshd man page the term "connection" is used very often in a way that is consistent with the definition I am assuming. For example, the section describing running sshd in debug mode
Code:
     -d      Debug mode.  The server sends verbose debug output to standard error, and does not put itself in the
             background.  The server also will not fork and will only process one connection.  This option is only
             intended for debugging for the server.  Multiple -d options increase the debugging level.  Maximum is
             3.

Evo2.
 
Old 08-22-2012, 01:58 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by dman777 View Post
I would think per a connection would be per a ipddress, if not what would define the "per a connection" criteria(since there is no authentication at this point the daemon does not keep track of the user but the connection)?
The definition of "per a connection" is a new tcp session. Started with the 3 way handshake. Ring any bells?

Quote:
Originally Posted by dman777 View Post
Yes, the behavior I have is once I reach the threshold, I can no longer log in ever for that user. The work around was to vnc into the host, raise the threshold, login successfully to reset the threshold for that connection. If I didn't do that would that connection be banned from logging in forever?
I doubt that behavior comes solely from the configuration of the MaxAuthTries. Might be another programm running that blocks your ip from connecting. fail2ban for example.
 
1 members found this post helpful.
Old 08-22-2012, 02:40 AM   #6
dman777
Member
 
Registered: Dec 2010
Distribution: Gentoo
Posts: 232

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by zhjim View Post
The definition of "per a connection" is a new tcp session. Started with the 3 way handshake. Ring any bells?



I doubt that behavior comes solely from the configuration of the MaxAuthTries. Might be another programm running that blocks your ip from connecting. fail2ban for example.
No, these are all my personal systems and they are bare min. so I know exactly what is running on them. No fail2ban. I had the wrong key, after the first failed attempt I kept getting disconnected with I reached maximum authentication tries messages. It is is not per a TCP handshake. Which brings me back to the original question on what resets this threshold assuming it's the ipaddress that is the source for the unauthenticated session.
 
Old 08-22-2012, 02:49 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

this is curious. A couple of things to check: have you checked the sshd logs (or better still run sshd -d) to see what is reported when a user is locked out? Also, do you see this behaviour when ssh to localhost (to eliminate possibilities of network, firewall, whatever issues)?

Evo2.
 
Old 08-22-2012, 07:36 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
Are you using pam_tally at all http://www.cyberciti.biz/tips/rhel-c...led-login.html ?
 
  


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
Sshd_config/ maas187 Linux - Security 7 04-21-2009 11:09 PM
sshd_config settings powah Linux - Security 3 06-03-2008 01:59 PM
SSH - MaxAuthTries Kristijan Linux - Security 5 09-27-2006 10:36 PM
SSH MaxAuthTries is not known dunsun Debian 1 09-05-2005 05:09 AM
sshd_config eyt Linux - Newbie 2 02-19-2004 12:05 PM

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

All times are GMT -5. The time now is 12:26 PM.

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