News for hackers. Stuff that matters.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by calgoo on Wednesday July 27, 2016 @11:16AM (#12173495)
Also, to get rid of 60% of the script kiddies, change the port to something high 1000+ (or even better 10000+). Its not a great option, but it does lower the amount of automated attacks that you get.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by JasuM on Wednesday July 27, 2016 @11:30AM (#12173601)
I'd be very cautious before moving SSH to a non-privileged port (over 1024). Any user on the server might start their own SSH server on the port assuming the real SSH server is dead. While this is hard to exploit (needs access to normal user, needs to kill real SSH server, need to get around SSH server key checking), it still is at least a theoretical reduction in security.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by HelloImDumb on Wednesday July 27, 2016 @02:43PM (#12175474)
Besides local iptables you can forward the port at the firewall level. Many people (myself included) have observed failed ssh logins going from many thousands daily to on average zero just by changing the port on a netfacing server. Of course a determined hacker who is after you can trivially portscan. But why not block all that noise and a huge percentage of shotgun attacks? If someone is out just to find servers to root with a new zero day they're liable to spray the net searching on the target port rather than portscanning all IPv4 space. Why not buy yourself some free time?

It is basically zero inconvenience to add an extra argument or shell setting.

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by netik on Wednesday July 27, 2016 @02:26PM (#12175334)
A user can always start their own SSH server. Just because you've decided to move it to a different port doesn't really encourage them. I suppose you could make this a bit more difficult for them by removing compilers (no really, you don't need compilers everywhere) and making sshd owned by root, mode 700...

However, proper ingress filtering or local iptables/pf rules would stop any unwanted inbound traffic from reaching your server, and you should definitely be using ingress and egress filtering on your network.

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by TheDong on Wednesday July 27, 2016 @11:54PM (#12178219)
removing firewalls has effectively no benefit; a non-root user can trivially download and run an arbitrary distro or package manager (e.g. nix from nixos, portage from a gentoo prefix, etc) and effectively do a chroot + package management without root.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by JasuM on Thursday July 28, 2016 @01:44AM (#12178564)
The point was that you could more easily replace the SSH server with a malicious one and e.g. hijack your agent when you connect to it.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by laumars on Wednesday July 27, 2016 @11:21AM (#12173535)
I'm not a fan of that option because it's causes an inconvenience for legitimate usage without offering any real security benefits. If you've hardened sshd then the biggest benefit you get from changing the port number is reducing the size of your log files. If you've not hardened sshd then you're just one nmap (et al) scan away from being in the same boat as you were previously.

If you really want to hide SSH from script kiddies then you're better off setting up firewall rules to whitelist trusted IPs. Heck, even port knocking[1] would be a better option than changing the port number.

[1] https://en.wikipedia.org/wiki/Port_knocking

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by MichaelGG on Wednesday July 27, 2016 @03:13PM (#12175704)
How is port knocking not, I dunno, at least 10x more inconvenient for users?

FWIW, I've never seen a brute force attack on SSH other than on port 22. Most likely, a targeted attacker would realise if you change the port, you're probably not going to have a trivial password.

Re:Ask HN: Anonymous person sent proof of SSH access to our ... by more_corn on Wednesday July 27, 2016 @04:43PM (#12176371)
I agree, I set up port knocking and it's a huge pain in the butt (so much so that I never moved it out of testing). It also lacks cryptographic verification. It's a lot of trouble for a not quite ideal solution.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by aaronmdjones on Wednesday July 27, 2016 @09:04PM (#12177697)
The Single Packet Authorization variant of port knocking has built-in authentication.
Re:Ask HN: Anonymous person sent proof of SSH access to our ... by laumars on Wednesday July 27, 2016 @04:44PM (#12176378)
Port knocking is more inconvenient but its also more secure. I'm not advocating it though, just example how low down the scale I consider non-standard ports as a sensible recommendation.

Random IPs are unlikely to be port scanned but any reasonably popular site will.