Hacker News .hnnew | past | comments | ask | show | jobs | submit | covertgeek's commentslogin

Haven't tried it for myself -- but looking at the code, it appears that the last rule needs to be changed to port 22 for SSH to work.


SSH should be immediately moved off port 22 in virtually any install.

The amount of toxic traffic hitting that port is scary.


It's indeed a large amount of traffic. But it's not scary. None of it will get through if your SSH software is up to date, you have it configured properly, and user accounts are managed sanely. The attacks to be scared of are those that are actually targeted at you. And they will find the port SSH is running on either way.


> None of it will get through if your SSH software is up to date, you have it configured properly, and user accounts are managed sanely.

So in the majority of cases, traffic will get through? :P


If you think someone could get in thru the ssh port (exploiting an undisclosed vulnerability or with brute force password cracking) moving it elsewhere is not a long term solution. fail2ban is good to avoid brute force attacks, but portknocking with i.e. fwknop will be safer in more situations. If a service is not meant for the public then they shouldn't be able to even notice that is there.


fail2ban and other programs that just grep a log file are a horrible idea as most of them can't properly parse a log entry and it's possible to inject an arbitrary ip address into the log file one way or another. I'm not sure if there are any outstanding exploits for the latest version of fail2ban right now but the whole concept of searching through log files that are in a format that can change at any time, aren't delimited properly, and subject to the sysadmin customizing is a precarious one at best.

Even if fail2ban and others were perfect, all it would take is the sysadmin customizing the log format to include some random field and all the sudden it's possible for an attacker to block every IP address with one request.

Source: http://seclists.org/fulldisclosure/2007/Jun/138

A better alternative is something like pam_abl which only protects logins to a user on the system but with it ssh is essentially unbruteforceable.


Does pam_abl work when you're not using PAM for authentication--only for authorization ("account") and session management? e.g., when UsePAM is enabled, but ChallengeResponseAuthentication and PasswordAuthentication are disabled.

I believe this is the problem with using pam_tally2. Then again, if you're only allowing PubkeyAuthentication then maybe you don't care about brute force login attempts so much.


Or perhaps firewall your server properly so only people who are meant to connect to port 22 can connect to it?


Oh I know, we could use iptables!


If you're worried about that, it probably shouldn't be publicly accessible in the first place.

Yes, moving ports helps, but it's not a real defense. It just lowers bandwidth costs and prevents some not-so-harmful attacks (from people who don't know whether what they've compromised has any value.)

At the very least, use public-key authentication instead of password authentication for SSH.


One nice side bonus to moving to non-standard SSH ports? Your log files are a lot less noisy.


You then also can easily detect bad behavior by watching failed connect attempts to port 22.


Not scary if you disable password logins, implement PKI, and limit logins to specific addresses.

I get a kick out of viewing all the failed attempts in /var/log/auth

Added bonus is adding all those bad guy addresses to my blacklists.


Every time somebody suggests this, you should not say it's for security purposes, but to reduce the load on a server.


And to reduce load on the person checking the logs.


passive port knocking should be standard.


Not sure if this is quite ready for primetime. I failed 4 out of 5 tries to prove I was human. The only one I passed was the wall clock pictures.

Edit: I'm using Chrome 27.0.1453.110 under Ubuntu.


I don't think you're committing career suicide. Sticking around indefinitely while you're miserable will not only suck the life out of you, but your drive to do well at work.

Might I recommend a book called Quitter by Jon Acuff? He's done a couple of books about making the leap from the corporate world to a more fulfilling "dream" job. It was a good, quick read.

If you've got the savings and a decent plan, I'd say go for it.


Yes. In the US, there are a couple of sites. The one that I can think of right off-hand is https://www.fbo.gov/.

There is also a book called Winning Government Contracts by Malcolm Parvey & Deborah Alston. ISBN: 978-1-56414-975-6


24 + Masters in Network Security


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: