LinuxQuestions.org
Review your favorite Linux distribution.
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 03-06-2006, 12:26 AM   #1
tariq_ned
LQ Newbie
 
Registered: Nov 2004
Posts: 6

Rep: Reputation: 0
Invalid logon attempts


Hi
I would like to stop invalid logon attempts.
I want to fix it on 3 attempts.

waiting for your reply

Tariq
 
Old 03-06-2006, 04:59 AM   #2
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
what do you mean by invaild log on attempts.

the only way to stop this is to remember your password...

you need to provide FAR more info here.... look at it from the perspective of someone who doesn't know your situation....
 
Old 03-06-2006, 05:21 AM   #3
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
I think he wants to lock the login on 3 unsuccessful attempts. Do you want this remotely, or locally?
 
Old 03-06-2006, 10:42 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Moved: This thread is more suitable in the Linux - Security forum and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 03-06-2006, 10:49 PM   #5
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Note that you need to think really carefully about how you'd like to implement this. For example an attacker could DoS the system simply by attempting logins and locking out accounts of other users including root. I've seen this solved with a whitelist approach or with a reset of the lockout after a certain period of time, but personally I don't like either one.
 
Old 03-08-2006, 12:21 AM   #6
tariq_ned
LQ Newbie
 
Registered: Nov 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Hi
Actually I want to limit the invalid logon attempts upto three times.After unsuccessful attempts system will allow after 5 minutes to try it again.
Actually this is requirment of aduit.

waiting for your help.

Tariq
 
Old 03-08-2006, 09:56 AM   #7
bruse
Member
 
Registered: Feb 2005
Location: internet
Distribution: Debian
Posts: 821

Rep: Reputation: 30
Why r u allowing for 3 attempt,i thing this is ur 3 post?That's what?
 
Old 03-08-2006, 09:42 PM   #8
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
To set the number of Auth tries, edit the sshd_config file and set the MaxAuthTries variable to 3. If your version of linux uses pam, you'll likely need to modify pam_tally settings in system-auth as well (likely lives in /etc/pam.d/). I don't believe sshd can do lockouts by itself, so you'd probably need to use pam.

Here are the pam docs, in particular look at the pam_tally section on this page. You'll likely need to use the 'unlock_time' variable and make sure to include magic_root to keep root from getting locked out. You'll still want to prevent remote root logins over sshd using the PermitRootLogins option in sshd_conf, but you don't want to lock root out locally, hence the magic_root setting. If that doesn't make an sense, read the pam docs

Last edited by Capt_Caveman; 03-08-2006 at 09:43 PM.
 
Old 03-10-2006, 05:24 AM   #9
tariq_ned
LQ Newbie
 
Registered: Nov 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Hi
Where sshd_config file exist.I was unable to find this file.
Kindly any one help me to find out this file.
send the complete path.
 
Old 03-10-2006, 05:33 AM   #10
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
it should be in /etc/ssh/

if not try "find / -name sshd_conf*"
 
Old 03-14-2006, 02:09 AM   #11
tariq_ned
LQ Newbie
 
Registered: Nov 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Hi
I set the variable MaxAuthTries to 3 but before that there is no variable exist,I typed my self in the file sshd_conf ans then save the changes but there is no effect appeared.Is there necessary to reboot the system ?
One thing I'd like to share with you is that, all vaiable was not active except one or two variable.

Waiting for reply
 
Old 03-14-2006, 06:12 PM   #12
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
You'll need to restart the sshd service so that it re-reads the config file. Make sure that the MaxAuthTries line is uncommented (doesn't have a '#' before it). All the other commented variables will be set to the default settings, so you don't need to worry about them right now. Note that the MaxAuthTries setting will only limit the number of authentication attempts *per connection*. So if a user fails 3 auth tries, then the connectino will be closed, but the user can still re-establish a new connection and will get 3 new authentication tries. To truly lock them out you'll need to use pam_tally.

Personally I think there are better tools to prevent bruteforce attacks against the sshd service. Take a look at this thread for some other solutions that I think will likely work better.
 
Old 03-22-2006, 04:59 AM   #13
tariq_ned
LQ Newbie
 
Registered: Nov 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Hi
I set the MaxAuthTries to 3.but Will it work when i attempt it locally or remotelly.
I tried it locally but it did not work.so kindly guide me regarding this.

Waiting for reply
 
Old 03-22-2006, 05:49 AM   #14
_KDF
Member
 
Registered: Oct 2003
Distribution: FC4/5 & RHEL4
Posts: 133

Rep: Reputation: 15
Try fail2ban, its very configurable and I have it set to after 3 unsuccessfull ssh login attemps it adds a rule to the firewall to ban the source IP for a week.
 
  


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
Emailing user logon attempts 09kevin77 Linux - Security 4 08-11-2005 02:19 PM
30 attempts needed for domain logon! bodyhammer Linux - Networking 6 04-11-2005 05:33 AM
What do you do with passing attempts? JordanH Linux - Security 4 10-26-2004 10:23 AM
squirremail ...it says invalid user or invalid password. rnj Fedora 9 10-25-2004 09:56 PM
restrict number of logon attempts depaul Linux - Security 5 07-28-2003 12:17 PM

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

All times are GMT -5. The time now is 02:38 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