Live data from Hacker News

Persistant SSH Threats?

news.ycombinator.com

21–29 of 29 posts

Re: Persistant SSH Threats?

#21

Earlier quoted context omitted.

SSH is less secure on an unprivileged port, this is a bad move. Use ssh keys and fail2ban, and filter your logs if you care about the attempts that much. This is like complaining that you're seeing web scrapers in your http access log: it's just background noise, it doesn't matter.

I did not suggest changing it to an unprivileged port, just a non default. Also you can change the Linux privileged port range with sysctl.

>you can change the Linux privileged port range with sysctl

I'm pretty sure you can't without recompiling the kernel, it's defined in the source in include/net/sock.h here: https://github.com/torvalds/linux/blob/master/include/net/so...

Re: Persistant SSH Threats?

#26

Earlier quoted context omitted.

I did not suggest changing it to an unprivileged port, just a non default. Also you can change the Linux privileged port range with sysctl.

>you can change the Linux privileged port range with sysctl I'm pretty sure you can't without recompiling the kernel, it's defined in the source in include/net/sock.h here: https://github.com/torvalds/linux/blob/master/include/net/so...

Newer kernels have the sysctl: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

Re: Persistant SSH Threats?

#27

Earlier quoted context omitted.

>you can change the Linux privileged port range with sysctl I'm pretty sure you can't without recompiling the kernel, it's defined in the source in include/net/sock.h here: https://github.com/torvalds/linux/blob/master/include/net/so...

Newer kernels have the sysctl: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

Oh very cool, thanks for the link! Learn something new every day

Re: Persistant SSH Threats?

#28
With X.509 certificates (publickey) and no passwords enabled, my new AWS server got lots of failed entries in /var/log/auth.log.

Following best practices, I set my sshd_config to specify another listening port - not 22.

My log is now clear of failed attempts.

Re: Persistant SSH Threats?

#29
Blacklistd (available natively on FreeBSD and NetBSD) are a good defense against these attacks. If you're using Linux you'll have to use fail2ban or something that scans log files for a similar. Using public key authentication and disabling password authentication is also a good idea.
Post reply on HN