LinuxQuestions.org
Visit Jeremy's Blog.
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 01-10-2013, 12:34 PM   #1
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Rep: Reputation: 13
Fail2ban Log


Hi all,

Just wondering if anyone can tell me why it might appear my router is attempting to log into my desktop repeatedly? Could it be something more sinister?

Here is a small selection of log.

Code:
2013-01-05 15:29:19,048 fail2ban.actions: WARNING [ssh] Ban 192.168.0.1
2013-01-05 15:39:19,672 fail2ban.actions: WARNING [ssh] Unban 192.168.0.1
2013-01-05 16:13:18,752 fail2ban.actions: WARNING [ssh] Ban 192.168.0.1
2013-01-05 16:23:19,383 fail2ban.actions: WARNING [ssh] Unban 192.168.0.1
2013-01-05 16:32:07,867 fail2ban.actions: WARNING [ssh] Ban 192.168.0.1
2013-01-05 16:42:08,389 fail2ban.actions: WARNING [ssh] Unban 192.168.0.1
2013-01-05 17:24:18,524 fail2ban.actions: WARNING [ssh] Ban 192.168.0.1
2013-01-05 17:34:19,055 fail2ban.actions: WARNING [ssh] Unban 192.168.0.1
2013-01-05 17:54:03,125 fail2ban.actions: WARNING [ssh] Ban 192.168.0.1
2013-01-05 18:04:03,795 fail2ban.actions: WARNING [ssh] Unban 192.168.0.1
Thanks
 
Old 01-10-2013, 12:49 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Check your /var/log/secure or equivalent for failed logins instead?
 
Old 01-10-2013, 02:52 PM   #3
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Hrm, don't seem to have anything that matches that or anything close, which I hope is a good sign?
 
Old 01-10-2013, 03:07 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Forgot to tell you the obvious: to also check your routers access logs ;-p If its logs are clean, or if it isn't the type of router that would allow one to telnet or SSH (or whatever else method) into and SSH to your machine anyway, then your jail.conf settings should have the routers IP in the "ignoreip" directive. I wonder though what you modified because jail.conf only lists /var/log/secure for the ssh-iptables jail and filter.d/sshd.conf only looks at SSH daemon messages and for a few "failregex"es...
 
Old 01-10-2013, 03:18 PM   #5
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
I just seen that it logs to '/var/log/auth.log'

Though have to say I'm a little confused: I used Sparkleshare which is what the user 'storage' is used for , but certainly my crappy router does not use that. 'Storage' also has failed logins.
Code:
Jan  6 09:47:33 desktop sshd[27851]: Set /proc/self/oom_score_adj to 0
Jan  6 09:47:33 desktop sshd[27851]: Connection from 192.168.0.1 port 51306
Jan  6 09:47:33 desktop sshd[27851]: Found matching RSA key: 
Jan  6 09:47:33 desktop sshd[27851]: Postponed publickey for storage from 192.168.0.1 port 51306 ssh2 [preauth]
Jan  6 09:47:33 desktop sshd[27851]: Found matching RSA key: 
Jan  6 09:47:33 desktop sshd[27851]: Accepted publickey for storage from 192.168.0.1 port 51306 ssh2
Jan  6 09:47:33 desktop sshd[27851]: User child is on pid 27853
Jan  6 09:47:33 desktop sshd[27853]: Connection closed by 192.168.0.1
Jan  6 09:47:33 desktop sshd[27853]: Transferred: sent 2648, received 2760 bytes
Jan  6 09:47:33 desktop sshd[27853]: Closing connection to 192.168.0.1 port 51306
 
Old 01-10-2013, 04:07 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Well you could get the same entries by doing LAN machine -> external address -> router NAT -> other LAN machine. If you know exactly which SSH accounts are allowed and if they all use pubkey auth you could add your routers IP to jail.conf.
 
Old 01-10-2013, 04:38 PM   #7
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Hi, I think that's what's happening as I have sparkleshare setup to work when I'm out and about too.

How would I add a second address to the jail.conf file please? Currently has 127.0.0.1/8 there, so just need to add the router's address.
 
Old 01-10-2013, 07:17 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Temporarily:
Code:
fail2ban-client set ssh-iptables addignoreip 192.168.0.1
permanently:
Code:
sed -i "s|^ignoreip.=.*$|\0 192.168.0.1|" /etc/fail2ban/jail.conf
fail2ban-client reload
 
  


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
Fail2Ban Patrick032986 Linux - Software 7 09-18-2011 04:01 PM
Fail2ban.log error. Havnt had before. :S dirtydog7655 Linux - Software 1 02-24-2011 03:55 PM
fail2ban stops loggs in auth.log tkmsr Linux - Security 1 02-12-2011 03:56 AM
fail2ban log errors for ssh jail linuxlover.chaitanya Linux - Security 2 07-24-2010 07:01 AM
[SOLVED] Configuring Conky to read log file entries - apache + fail2ban djsmiley2k Linux - Desktop 1 04-26-2010 04:29 AM

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

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