Brute Force
None of them are accounts on my system, I have root by ssh turned off, and am now running ssh on a non standard port, but what should I do about it, I have all these attempts from one IP, it seems to be a very determined attempt on my server.
I realise that this is a very crude attempt to try to compromise my system and such a hacker is probably not dangerous. Should I just ignore such an attack?
Cheers guys.
16 Replies
It is nothing to feel special about, not a targeted attack. However, if you have any stupid passwords like guest/guest, testing/password and such, eventually someone is going to guess right.
I think turning off root access should be sufficient, as well as not adding common usernames with bad passwords.
I personally take no risks and have absolutely no passwords, just keys.
As long as you don't have bad passwords, generally they won't get in. However, here's a neat little tool I've heard about (but haven't tried, since I'd probably just implement my own perl scripts to do this anyway):
http://fail2ban.sourceforge.net/
It watches the log files for failed login attempts, and then adds those IPs to the deny list.
DenyHosts
Cheers.
Remember if need be you can always log in via LISH so you won't be locked out if you have to access your Linode from a different computer occasionally.
Andrew
Cheers All.
One good link I found quickly:
@NecroBones:
Just thought I'd "support" Fail2ban by saying that it works great, and that it's very easy to set up even if you don't know much about Linux; extra especially superduper easy, and if you order now you'll recive 10% more peace of mind for free, if you are using Debian, of course.
/Tony - recovered Red Hat source code-junkie turned pro-package Debian user.
iptables already has mechanisms in place for blocking traffic that crosses a threshold. You don't have to have another daemon running using valuable RAM or a process constantly scanning a log file looking for authentication failures. You also don't have an input chain that is 800 rules long. Check out this sample Debian init.d script that limits new connections to port 22 to 3 per 60 second interval:
Mike thanks for the input on the fail2ban suggestion, that information is quite valuable and it I hadn't known how fail2ban worked I may have employed a solution using that.
Having said that Tony, your mentioning it is appreciated too, as if people don't suggest things how can we get alternatives to solving our problems, and if it were not a Linode, UML type of system then it may have been an excellent choice.
Thanks to everyone, and I feel that I have built a more secure system thanks to everyone's help
Cheers.
@mikegrb:
One problem with something like fail2ban is the extra resources it consumes. By default it scans the log once every second, imagine the IO tokens this consumes on a Linode!
You're right, Linode sucks… thanks for pointing that out… Now if you all excuse me I'm going to go and cancle my account…
This page might be of some use for people interested in this (I don't think I've seen it mentioned here before, correct me if I'm wrong): Using iptables to rate-limit incoming connections
Fail2ban is very easy to use, so unless you know that your server can't handle it it's a great solution; I'm using it mainly because it's fun to get e-mails about people getting blocked.
@mikegrb:
One problem with something like fail2ban is the extra resources it consumes. By default it scans the log once every second, imagine the IO tokens this consumes on a Linode!
BTW, I think I've got a pretty good grasp on how it works with those IO tokens here, but it really should be easier to get that information and for non-tech people to understand what it really means.
Is that information easily available somewhere and I've just missed it?
@tony:
BTW, I think I've got a pretty good grasp on how it works with those IO tokens here, but it really should be easier to get that information and for non-tech people to understand what it really means.
Is that information easily available somewhere and I've just missed it?
Is this helpful?
That said, I somehow knew about the iotokens issue before I signed up and have always known to cat /proc/iotokens when I'm having issues. I just can't recall HOW I knew to do this – probably lurking in the forums for a while.
By the way, I found mikegrb's reply really useful. And I completely understand why there is a need to limit io, given the machine hardware is shared.
@ryantate:
It seems like a good thing to put in the FAQ. I just looked and was surprised it was not there. If anything is Frequently Asked, the io thing is it.
That said, I somehow knew about the iotokens issue before I signed up and have always known to cat /proc/iotokens when I'm having issues. I just can't recall HOW I knew to do this – probably lurking in the forums for a while.
By the way, I found mikegrb's reply really useful. And I completely understand why there is a need to limit io, given the machine hardware is shared.
Another nice feature, tied to this, would be to get automagic warnings about the performence of ones Linode; allowing the admin to either learn more about how to optimize the setup, or, more likely, just put themselfs inline for an upgrade… No more thinking about where the problem is, they'd just push a button or two to get and upgrade when needed.