I have servers hosted at Linode.com, have had them for several years now. While I am working or sleeping I rarely ever have an issue. But that doesn’t mean something isn’t happening with them. In fact, beyond the normal traffic I would expect them to get, I often get attacks via port scans, sshd login attempts, etc.
I take what some would consider above average security precautions. I’ve been called anal in the past by friends because I wouldn’t expose FTP or unnecessary protocols blindly. Instead I tell them to get an SSH tunnel client and use any service they want to through the secure pipe. Its easy enough to do even for customers from their desktops.
Besides the public SMTP/POP/IMAP and WEB, the only other major service I may expose to the WWW is SSH. Which ends up resulting in someone who doesn’t belong on my server, trying to get on it. Oh yes, I see every attempt as I use logcheck to drop me occasional emails throughout the day informing me of what is going on. To be honest, I’ve had this email log checker being sent to me for years. And I often think of the day that I will turn it off…but then the what if scenarios pop into my head, and I don’t do it.
Well I had enough with the failed sshd login attempts.
Security Events
=-=-=-=-=-=-=-=
Aug 27 16:32:00 smallbox sshd[20823]: Failed password for root from 130.206.132.121 port 44533 ssh2
Aug 27 16:32:03 smallbox sshd[20825]: Failed password for root from 130.206.132.121 port 44789 ssh2
Aug 27 16:32:06 smallbox sshd[20827]: Failed password for root from 130.206.132.121 port 44974 ssh2
Aug 27 16:32:10 smallbox sshd[20829]: Failed password for root from 130.206.132.121 port 45191 ssh2
Aug 27 16:32:14 smallbox sshd[20831]: Failed password for root from 130.206.132.121 port 45456 ssh2
Aug 27 16:32:17 smallbox sshd[20833]: Failed password for root from 130.206.132.121 port 45698 ssh2
Aug 27 16:32:20 smallbox sshd[20835]: Failed password for root from 130.206.132.121 port 45919 ssh2
Aug 27 16:32:23 smallbox sshd[20837]: Failed password for root from 130.206.132.121 port 46153 ssh2
Aug 27 16:32:26 smallbox sshd[20839]: Failed password for root from 130.206.132.121 port 46379 ssh2
Aug 27 16:32:30 smallbox sshd[20843]: Failed password for root from 130.206.132.121 port 46619 ssh2Before you say….but wait you listed their IP here! Do you really think I care?
BTW…it came from Amsterdam.
Adding fail2ban into the mix…
fail2ban will monitor events (in my case log files from auth), mark IP’s as bad for a configurable time (minutes, days) and release the jailed IP after that configurable time. (more…)