Live data from Hacker News

What SSH Hacking Attempts Look Like

medium.com

51–60 of 186 posts

Re: What SSH Hacking Attempts Look Like

#51
post #50

Earlier quoted context omitted.

Please educate me

grep PasswordAuthentication /etc/SSH/sshd_config

Which is worse then using cat, from a user perspective.

Imagine if you look for something else, you have to point the cursor in the middle, right after grep and before the file. With cat |grep you press Arrow-up and Alt+Backspace and you are right where you want to be, ready to search for something else.

In scripts you can save the extra process though.

Re: What SSH Hacking Attempts Look Like

#52
Changing the SSH port proved to be most successful. Yes, of course you can find the port with a port scan. But it keeps the logs clean. And I don't want to waste CPU cycles on some brute-forcing idiots.

Re: What SSH Hacking Attempts Look Like

#53
post #46

I am slowly closing all non-vital ports on my router and just letting services accessible from within the VPN. No open port = no hacking attempts. Investing a week of on-and-off studying and tinkering with openvpn is really paying off.

> No open port = no hacking attempts.

That's just obviously nonsense? Closing the port does not change anything about the attempts. Nor about the success rate of the attempts, if you aren't being an idiot with insecure passwords.

Re: What SSH Hacking Attempts Look Like

#54
post #51
post #50

Earlier quoted context omitted.

grep PasswordAuthentication /etc/SSH/sshd_config

Which is worse then using cat, from a user perspective. Imagine if you look for something else, you have to point the cursor in the middle, right after grep and before the file. With cat |grep you press Arrow-up and Alt+Backspace and you are right where you want to be, ready to search for something else. In scripts you can save the extra process though.

You mean ctrl-w or bC? ;-)

I would find it okay without cat to start the next line with "grep newPattern " and then fetching the previous filename with alt-. (edit: or !$ of course, but alt-. is more practical) -- not saying it's necessarily always better, but knowing your shell better (and/or using a better one) is often a viable alternative to using another construct.

Also, than* (sorry)

Re: What SSH Hacking Attempts Look Like

#55
post #3

$ grep -c sshd /etc/hosts.deny 1192 $ uptime 11:58:51 up 327 days, 21:33, 1 user, load average: 0.13, 0.11, 0.09 I'm using DenyHosts for this, there are alternatives but this works for me. http://denyhosts.sourceforge.net/

you should probably upgrade that kernel

Re: What SSH Hacking Attempts Look Like

#56
post #54
post #51

Earlier quoted context omitted.

Which is worse then using cat, from a user perspective. Imagine if you look for something else, you have to point the cursor in the middle, right after grep and before the file. With cat |grep you press Arrow-up and Alt+Backspace and you are right where you want to be, ready to search for something else. In scripts you can save the extra process though.

You mean ctrl-w or bC? ;-) I would find it okay without cat to start the next line with "grep newPattern " and then fetching the previous filename with alt-. (edit: or !$ of course, but alt-. is more practical) -- not saying it's necessarily always better, but knowing your shell better (and/or using a better one) is often a viable alternative to using another construct. Also, than* (sorry)

Or Alt+Backspace

I don't see how the rest is faster than using Arrow-Up and deleting the last word. It seems more complicated. The most important string is still in the middle.

Re: What SSH Hacking Attempts Look Like

#57
post #46

I am slowly closing all non-vital ports on my router and just letting services accessible from within the VPN. No open port = no hacking attempts. Investing a week of on-and-off studying and tinkering with openvpn is really paying off.

What about http and https ports on a home web server?

Re: What SSH Hacking Attempts Look Like

#58
post #13
post #12

Earlier quoted context omitted.

Port knocking + key-based auth... What more do you need?

What benefit does port knocking add to having a key auth only setup?

Ideally, your port-knocking service is much simpler and easier to audit than your ssh service. It's also much more obscure. So you have a service which is very unlikely to suffer a 0-day vulnerability listening all the time to engage a much more vulnerable service only at those exact times you need it.

Re: What SSH Hacking Attempts Look Like

#59

My current take: nftables instead of iptables port-knocking non-standard port key+pass access/auth ip whitelist good logging ED25519 wherever possible!!!

IP whitelist is tough when your home network has a dynamic IP.

IP-Range would stay relatively similar.

Re: What SSH Hacking Attempts Look Like

#60
post #7

I never understood why people would use fail2ban or similar approaches. Just set proper password and move on. SSH traffic is tiny, it's not a problem. You'll never be hacked with a proper password. Let them waste their time.

The failed attempts make it harder to monitor for other attacks because of the noise in log files, network traffic, etc. and if an attacker IP is blocked early they can't try more effective attacks.

Except actual attacks don't show up in logs anyway, so it's still pointless?

The SSH daemon logs when it successfully rejects an access. A successfully rejected access is inconsequential to your security. If you are using secure passwords or pubkey authentication, it will never log a successful login by an attacker. What remains then is exploitation of the SSH server ... but the SSH server doesn't have a code path that logs "I have been exploited".

Post reply on HN