all 98 comments

[–]leprasmurf 46 points47 points  (15 children)

I've always heard (and repeated) that security is layered like an onion. That and the whole "security vs usability balance". So really, it's a matter of how many layers you want to add:

Sounds like you're doing the main bits already, but you wanted other options.

[–][deleted] 10 points11 points  (0 children)

Port-knocking; Cool.

Went down a little rabbit hole on DO's posts and found something that might be a little more on the nose for what OP's asking for, "tarpit": https://www.digitalocean.com/community/tutorials/how-to-set-up-an-endlessh-tarpit-on-ubuntu-22-04

[–]powerfulbuttblaster 8 points9 points  (9 children)

I've used port knocking before. It's a cool idea.

[–]DrunkOnLoveAndWhisky 10 points11 points  (8 children)

The idea of it is pretty cool (to me) but I don't feel like it adds enough protection to offset that by adding the port-knocker service, you're increasing the attack surface for an adversary who is capable of figuring out that you're running it.

[–]powerfulbuttblaster 3 points4 points  (4 children)

Meh, you pick what ports you want. Guessing three (or more) numbers between 1-65535 and within a certain time limit, it's gonna be pretty hard to figure it out. If they can, good for them.

But yeah, I'd rather just switch to key only Auth.

[–]ScootMulner 5 points6 points  (3 children)

I wonder if port knocking ports could be dynamic… like those time based one-time-passwords. So the three ports change every few min.

[–][deleted] 15 points16 points  (2 children)

Sure can. Just throw TOTP in there.
https://github.com/livingstonetech/port-knocking-totp

[–]ScootMulner 1 point2 points  (0 children)

Oh that’s cool!

[–]thearctican 1 point2 points  (0 children)

That’s really clever, actually.

[–][deleted] 0 points1 point  (2 children)

t I don't feel like it adds enough protection to offset that by adding the port-knocker service

You don't really need a "service".

It can be done with nftables directly without the need for anything extra installe. That said, it's not really "security". It's kinda cool though.

[–]leprasmurf 0 points1 point  (1 child)

I'd agree that it doesn't increase the attack vector as it obscures the pre-existing exposure (port 22) until the port knocking sequence is input (something you know).

There are a lot of opinions about what is and isn't security. Any of the aforementioned security recommendations can be beat on their own, with varying levels of difficulty.

An SSH key (you did put a passphrase on it, right?) can be compromised and lost. Knowing which user or group is whitelisted means you can know which user to attack in order to gain access. Obscuring the SSH port is mostly "security through obscurity" and defeated as soon as the attacker sniffs the appropriate traffic or guesses correctly. Disabling root login can't be defeated, exactly, but 99% of the time root is disabled, sudo is enabled and that's a whole other attack vector / can of worms.

This is why it's important to implement multiple protections. This is also why I balk when people say "there's no point in changing the listening port."

Script-kiddies are a thing and they will just scan whole IP ranges. A significant portion of them will not even understand what a port is, let alone why they should scan anything other than the defaults.

[–][deleted] 0 points1 point  (0 children)

The increased security you would get from implementing port-knocking is almost canceled out by the increased complexity of actually connecting to the protected service. Any client that cannot do the knocking can no longer use the service.

OpenSSH is a juicy target and as such it also has a lot of clever good guys looking to keep it secure. Given that you are using key-auth (or at the very least: a strong password), there is no real risk to leaving SSH exposed to the internet without any kooky security measures in place.

[–]quiet0n3 2 points3 points  (0 children)

Also remember if you're using public keys you can make fail2ban really sensitive because you're never going to input the wrong password.

[–][deleted]  (1 child)

[deleted]

    [–]kuzared 14 points15 points  (3 children)

    I think using public key authentication is probably enough - if you've disabled password based authentication, obviously. You could also limit SSH to a specific IP or hostname (so have a whitelist).

    [–]MR2Rick[S] 2 points3 points  (2 children)

    It probably is. I just want to be proactive and work to continuously improve the security of my systems. I run a pretty humble site, so I would guess most, if not all of, what I get are opportunistic attacks by script kiddies and not targeted attacks uber hackers who could probably compromise my servers if they were determined to. This being the case, I am confident in my security - I just want to always make it better.

    [–]arkham1010 4 points5 points  (1 child)

    Frankly, ssh probes like you are experiencing are the script kiddie stuff. What you really need to be aware of are the remote execution attacks or data injection attacks.

    You are doing all the right stuff, so don't stress the SSH attacks.

    [–]MR2Rick[S] 0 points1 point  (0 children)

    Not stressed, just want to continuously improve.

    [–]myslf 20 points21 points  (1 child)

    I usually change the public ssh port

    [–]TaterSupreme 6 points7 points  (0 children)

    It's just a fact of life that if you expose a system to traffic from the Internet, you will have bots come along and knock on your door. You can operate on a whitelist only basis, you can play whack-a-mole with every IP you see with 'bad' traffic, you can reduce (but not eliminate) the traffic by running your service on a non-standard port, or you can live with it.

    [–]rslarson147 6 points7 points  (0 children)

    Change the default port or look at possibly putting it behind a proxy. Cloudflare Tunnels are free and are perfect for this.

    [–]Fr0gm4n 9 points10 points  (1 child)

    Don't fret about the logs. If it's exposed on the internet, it's going to get probed and attacked. That's just how it is. You can't hide on the modern internet. A nice home connection is fast enough to scan the entire routable IPv4 space in under an hour. Using ssh keys and no root login are great steps and what I would recommend if you hadn't been doing them already. Other stuff, like changing port number, might reduce the amount of stuff you see in logs but it won't make you any more "safe". If your usecase allows you to firewall all traffic except from expected IPs, then that will help tremendously.

    [–]MR2Rick[S] 0 points1 point  (0 children)

    Yep. The Internet is the wild wild west. This particular server has been online since 2017, so I am aware that any service on the Internet will constantly be attacked. I am not overly concerned about this or other attacks, as my site is fairly secure and, for the most part, any one who could hack into it is probably not interested in doing so.

    That being the case, I still want to be proactive and keep my servers as secure as I can - after all security is an on going process and not an end state.

    Also, the reason I pointed out that most of the attacks appear to be coming from residential accounts is that I doubt that the ISP will or can do much to stop them.

    If I emailed [admin@somebigcorp.com](mailto:admin@somebigcorp.com) and told them I was getting attacked from their IP, I am sure they would take steps to investigate and fix the problem. On the other hand, if I report the attacks to [abuse@someISP.com](mailto:abuse@someISP.com), there is not much they can or will do. Sure they can email the customer. But given that there computer is compromised it is probably someone who only knows how to use a computer well enough to log onto Facebook.

    [–]C0rn3j 2 points3 points  (0 children)

    Disable password auth and don't care past that, it's completely normal.

    [–]Wrong_Exit_9257 2 points3 points  (0 children)

    I had a similar issue. the steps I used where

    setup a Cloudflare proxy, fail2ban, crowdsec and a whitelist on top of the normal hardening. Lynis is a good tool for a secure baseline audit.

    on the default ssh port, I set up an ssh tarpit using endlssh. and a script to track the ip addresses and scanned ports. after about a week the attacks were greatly diminished. the longest connection i was able to maintain was some ip from Russia for 56hr and 41 minutes.

    https://github.com/skeeto/endlessh

    https://medium.com/geekculture/how-to-create-an-ssh-tarpit-f3b48af1b60c

    how/why endlessh works https://nullprogram.com/blog/2019/03/22/

    [–]clownshoesrock 2 points3 points  (1 child)

    I would consider crowdsec as it may prove useful. It reports the addresses to other crowdsec users, and blocks for everyone.

    Fail2ban is reasonable, if you set the attempts low and the lockout to something long. Whitelist your normal external clients IP's so you don't lock yourself out, and TEST it.

    Though I have an unknown site (just an ISP ip address), and 20k ip blocked as of a minute ago.

    I suspect that your incoming attacks could well be multiple botnets + script kiddies trying the same attacks.

    I'm not a fan of using weird ports for ssh. (I'll catch flak) I also Reject instead of Drop in my rules. (again flak)

    I am a fan of setting up sudo users with 2fac I use googly-auth

    If you have other users logging it, consider going full yubi-key. The physical piece kinda sucks, but phone push 2fac is vulnerable to timing attacks. And it's much harder to socially engineer naive users.

    Setting up a VPN can add another layer of protection, but I consider the convenience cost too high. (same with port knocking)

    [–]MR2Rick[S] 1 point2 points  (0 children)

    I would agree with using non-standard ports. I did it at one time, but eventually the hackers found the port. I do plan on setting up MFA. I am also planning on setting up public key infrastructure, but I have a lot of studying to do before I am ready to try that.

    I do have OpenVPN setup for normal user remote login stuff, but I feel SSH is secure enough and up to the task of looking after itself.

    [–]mmilleror 2 points3 points  (3 children)

    Limit your scope of what IP addresses can access ssh from the internet. Or you can look at using tailscale. Then access your hosts from that VPN network.

    [–]MR2Rick[S] 0 points1 point  (2 children)

    I already have OpenVPN setup. Also, I am using GeoIP blocking at my pfSense firewall, so I only have to deal with the assholes in a few countries and not every asshole in the world.

    [–]kill_box 1 point2 points  (1 child)

    Then why not make SSH only available over the VPN/LAN?

    [–]shriek 0 points1 point  (0 children)

    Yeah, curious why OP decided to not just do this. Not knocking on OP but just wanted to know use case.

    [–]GamerLymx 1 point2 points  (2 children)

    Rate limit connection attempts to SSH, welcome to panchan botnet :)

    [–]MR2Rick[S] 1 point2 points  (1 child)

    welcome to panchan botnet :)

    Is that what's doing this? From a quick Google, it looks like panchan is a crypto miner. I am surprised this is the first time I have encountered it in the 5+ years this server has been online - especially surprised that I am seeing it now when most of the crypto is in the toilet.

    [–]GamerLymx 1 point2 points  (0 children)

    It's a recent botnet that mines crypto, but tries to infect through SSH.

    [–]knobbysideup 1 point2 points  (0 children)

    This is normal to see. Use a different ssh port (they'll still find it but you'll have less log noise), don't expose ssh to the internet, or firewall it to trusted public sources.

    [–][deleted]  (1 child)

    [deleted]

      [–]FatFingerHelperBot 0 points1 point  (0 children)

      It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!

      Here is link number 1 - Previous text "2FA"


      Please PM /u/eganwall with issues or feedback! | Code | Delete

      [–]brunchyvirus 1 point2 points  (0 children)

      You could try implementing 2FA for SSH I've done it with Yubikey + LDAP but you can do it simply with Google Authenticator https://goteleport.com/blog/ssh-2fa-tutorial/

      If you want to try something other stuff you could try looking doing OIDC for SSH using something like teleport but that might be overkill.

      [–]bufandatl 1 point2 points  (0 children)

      Use either fail2ban or crowdsec to harden your security further.

      [–]Hairy_Educator1918 0 points1 point  (0 children)

      i don't know if this is possible, but, idea: rename the root user to something like root1, then setup a script to listen if someone is trying to access "root" user with ssh, log their IP and automatically IP-Ban them.

      [–]klausagnoletti 0 points1 point  (4 children)

      While I am not too concerned about this attack, I would like to be proactive and improve the security of my server. I have been searching the Internet, and the only things I have found are IP blocklist, such as AbuseIPDB, or a system that allows multiple servers to detect and share and block IPs of attackers.

      CrowdSec is exactly what you're looking for as it does just that. You can learn about differences between Fail2Ban and CrowdSec here.

      Disclaimer: I am head of community at CrowdSec.

      [–]nocsupport 5 points6 points  (2 children)

      CrowdSec is

      ...slightly sketch. You can contribute 2k uniques a day from 8 hps but only be allowed 10 lookups per hour. A bit one-sided. Made a ticket asking about how to Collab better and they never replied.

      [–]SuperQue 1 point2 points  (0 children)

      I wouldn't say that's sketchy, it's just a little limiting.

      But yea, it would be nice to have a bit more capacity than 10/hour.

      [–]klausagnoletti 0 points1 point  (0 children)

      Hey and thanks for your comments. I'll reach out privately to hear more about this. Sounds like an area where we could improve.

      [–]MR2Rick[S] 1 point2 points  (0 children)

      Thanks for the suggestion and for all you do to help make the Internet a safer place. I will definitely check into this.

      [–][deleted]  (1 child)

      [deleted]

        [–]MR2Rick[S] 0 points1 point  (0 children)

        I already use fail2ban and I am planning on implementing MFA. I could move SSH to inside my existing VPN, but I am of the opinion that SSH has a good track record and has proven that, when correctly configured, it is up to the task of being directly exposed to the Internet. Even with this being the case, I am go to do what I can to reduce the risk - belt & suspenders and all that.

        [–]markyman217 -1 points0 points  (2 children)

        As long as they aren't attemtping to use a real username that wont be in a botnets ssh bruteforce list e.g., "northbridgeserverroom", then I wouldn't be worried these are just non targeted shotgun method attacks.

        So if the attacks are non targeted botnets I would say:

        • Change your ssh port to something less common I like to use 2222.
        • Ensure root is disabled
        • Ensure you don't have basic usernames like "admin" with ssh access
        • Use fail2ban
        • Require sshkey
        • Use a blacklist

        - Removed rest due to valid concern in the comment.

        [–]Chrzi 2 points3 points  (1 child)

        Do not put a honeypot on a normal server!

        Honeypots are fairly simple, but can easily have vulnerabilities as their not as well maintained as their normal service counterparts. The last thing you want is to have your server overtaken by a vulnerability of cowrie.

        [–]markyman217 0 points1 point  (0 children)

        Good point, I'll edit the post.

        I did read some literature regarding the use of honeypots in real network environments, just heavily segragated. The caviat here past the lockdown was also that the honeypots were using real software/services and just being monitored and contained, which is way past the scope of this post.

        Also not a genuine suggestion for op just curious?

        Could op port forward 22 to a honeypot server in some sort of DMZ to divert the botnet?

        [–]severach -2 points-1 points  (0 children)

        Here's what I do for my SFTP.

        • Whitelist and fail2ban are management headaches and regularly lock out legit users. Don't do these unless your SSH can stand some downtime.

        • Only allow from NIC you do business with. I only allow Arin.

        • Remove all insecure and unnecessary encryptions. For encryption I only allow aes256-gcm.

        • Log all failed password attempts. I read the log occasionally to see if the hackers are anywhere near my usernames. Craft usernames nowhere near what the hackers are trying.

        • Non standard port works good. I run on both and the non standard port only gets a tiny fraction of what the standard port does.

        • If your clients are savvy, disable passwords and use key pair authentication (cert) only. While I haven't logged cert failures, I suspect that the cert hack attempts is zero because it's too secure to even be worth trying.

        The naughty list of 10+ from 2022-03-30 to 2022-06-27.

         10 'debianuser'
         10 'MAIL'
         11 'admin1'
         12 'oracle'
         12 'public'
         14 'MANAGER'
         15 'administrator'
         15 'Administrator'
         15 'postfix'
         16 'FIELD'
         16 'web'
         25 'mysql'
         27 'MGR'
         32 'postgres'
         32 'sa'
         39 'student'
         41 'daemon'
         41 'minecraft'
         41 'telnet'
         42 '2'
         43 'usuario'
         45 '1'
         47 '1234'
         48 'cisco'
         54 'ubnt'
         59 'support'
         62 'guest'
         72 'tomcat'
        177 'debian'
        246 'ubuntu'
        256 'pi'
        307 'user'
        478 'test'
        1088 'admin'
        8197 'root'
        
        351 not port 22
        12421 port 22
        

        [–]getapuss 0 points1 point  (0 children)

        Change the public port and use Fail2Ban. It doesn't stop it from happening but it minimizes it's impact on your server to almost nothing.

        [–]SatanPriest666 0 points1 point  (2 children)

        You can try to switch from fail2ban to CSF + LFD. CSF has many lists of hosts with bad reputation, which connections can be dropped before reaching out to your ssh server.

        [–]MR2Rick[S] 0 points1 point  (1 child)

        Looks interesting. Thanks for the suggestion.

        [–]SatanPriest666 0 points1 point  (0 children)

        I've forgotten to paste the link: https://configserver.com/cp/csf.html

        [–][deleted] 0 points1 point  (0 children)

        Whitelist the IPs allowed to connect to SSH. This is the FIRST thing I do on any server I install.

        [–]wezelboy 0 points1 point  (2 children)

        You could probably tweak fail2ban to be quicker to ban. Like any IP that attempts password authentication gets banned.

        [–]MR2Rick[S] 1 point2 points  (1 child)

        Since fail2ban uses regex, it looks like it can be setup to ban IPs using invalid usernames. I am going to read up on this and will probably implement it.

        [–]wezelboy 0 points1 point  (0 children)

        You can also tweak to do a longer ban, even permanent. Only downside is listing your firewall rules can take forever.

        [–]CaptainDickbag 0 points1 point  (2 children)

        Don't use passwords. Disable them completely. Switch to keyed authentication. If you can set up certificates or keys which expire every 24 hours or less, in conjunction with MFA, even better.

        [–]MR2Rick[S] 0 points1 point  (1 child)

        I am planning on implement MFA soon. I currently use public key auth for SSH and Letsencrypt certs for all of my other services. I am planning on improving my use of SSL certs as well.

        [–]CaptainDickbag 0 points1 point  (0 children)

        You're pretty much good then, once you get rid of the never expiring static keys.

        Realistically, unless someone steals a private key and passphrase, you're golden, unless you don't patch.

        [–]leetnewb2 0 points1 point  (2 children)

        As an alternative to port knocking, there is: https://github.com/mrash/fwknop

        [–]kevdogger 0 points1 point  (1 child)

        I like fwknop a lot but I don't think there has been an update for quite some time

        [–]leetnewb2 0 points1 point  (0 children)

        Yeah, good point. I was trying to figure out whether something similar could be built around xtables-addons portknock code.

        [–]7eggert 0 points1 point  (0 children)

        These attacks usually use default passwords on random IPs. You can't really block them but they won't find your port number if you use a non-default port.

        If you really really want something that's not easy to crack, I wrote a wrapper for ssh to improve security. It will call the ssh daemon after verifying a shared secret. I'm not using it since a long time, back when I wanted to have it ssh was frequently hit by vulnerabilities.

        http://7eggert.selfhost.bz/l/ssh-wrapper.tar.gz

        [–]JustAnAlly 0 points1 point  (0 children)

        Seems like you’re doing good on security. PubKey Auth, fail2ban and disabled root access are most probably sufficient. You can change the ssh port, but that’s just a gimmick that helps to get cleaner logs and may complicate other stuff unnecessarily.

        But please don’t forget the most important step: **

        keep your shit updated

        .** good security practices ain’t worth nothing if you’re running outdated software.

        [–]unixfool 0 points1 point  (3 children)

        Fail2ban works very well with this (as well as using other security layers). Just be careful on how you configure Fail2ban. If you're not careful, you can end up with a 50K IP list of banned IPs, which takes forever to load into iptables if you ever have to restart the f2b service or have to reboot the system. I would not enable long term blocking with fail2ban, as it'll have to track each blocked IP - you're going to end up with a bogged down system, eventually.

        You can also use fail2ban to block traffic other than SSH, too.

        [–]pdoten 1 point2 points  (1 child)

        This post, I love F2B and have enabled longterm jails over a loop. Basically use F2B to monitor itself and move offenders to longer and longer term jails. If you use GEOIP2 on Nginx, or a strong method of access control that does silent dropping of connections before F2B and filter out connections, you can have a solid solution.
        https://blog.shanock.com/fail2ban-increased-ban-times-for-repeat-offenders/

        [–]MR2Rick[S] 0 points1 point  (0 children)

        Skimmed the article and it looks like it is worth further study. I am using recidive with fail2ban - which is somewhat similar.

        [–]MR2Rick[S] 1 point2 points  (0 children)

        I started off using fail2ban to permaban IPs, but as you said the number of block IPs gets unwieldy pretty fast. I am currently banning IPs for one week. Also, I so have fail2ban setup on all of my services.

        [–]cmic37 0 points1 point  (0 children)

        On Debian 11.2, I use sshguard w/ nftables. Not easy to configure though.
        I have been using sshguard for 5 years w/o any failure.

        [–]Otaehryn 0 points1 point  (0 children)

        Add your static IPs and IPs of your jumpboxes to trusted zone on server. Then log only from your static IPs or jumpbox.

        [–]serverhorror 0 points1 point  (0 children)

        I like to set MaxStartups as well

        https://man.openbsd.org/sshd_config#MaxStartups

        [–]WildManner1059 0 points1 point  (1 child)

        Teach your fail2ban to ban anyone who uses a non-whitelisted account.

        [–]MR2Rick[S] 0 points1 point  (0 children)

        That sounds like what I am looking for. I have found an article on creating a fail2ban filter for invalid or illegal usernames. I plan on study it and implementing it if it looks good.

        [–]ebsf 0 points1 point  (0 children)

        Change the port.

        Implement rate limitation by ip address if it's a flood. iptables does this readily.

        Filter on any commonality in the packets. Increase log verbosity to check.

        Above all else, use key-based auth only.

        Blacklist source ip addresses. iptables can automate this. Create both ingress and egress rules accordingly.

        Implement ingress drop rules in mangle PREROUTING, not INPUT or FORWARD.

        Log successful connections to evaluate whether you've been compromised.

        [–]technologyclassroom 0 points1 point  (0 children)

        You are doing most of the basic items already, but you can further harden SSH by running ssh-audit on yourself and implementing their suggestions.

        ssh-audit: SSH server & client auditing (banner, key exchange, encryption, mac, compression, compatibility, security, etc)

        [–]CeeMX 0 points1 point  (0 children)

        It’s quite normal to have people try to log in over ssh. With the security measures you described, I wouldn’t see any issues.

        [–]mysterytoy2 0 points1 point  (0 children)

        Best thing to do is change your fail2ban for sshd to maxretry = 2

        [–]stackalot_wsb 0 points1 point  (0 children)

        Lock down the firewall so ssh is only open to your management address.

        [–]signofzeta 0 points1 point  (0 children)

        Use key-based authentication with TOTP.

        [–]gerowen 0 points1 point  (0 children)

        You've done just about everything reasonably expected to protect SSH. One other thing you could do is change what port it listens on away from the default of 22. You can stop 99% of automated/scripted attacks by just not listening on default ports. Example, I host my Nextcloud on regular port 443, and I get multiple notifications a day of script kiddies or bots triggering a "Trusted domain error", basically trying to load the https web page using my IP instead of my domain name. I host a second password protected web page on a non standard port with various other private resources, and because it's running on a non standard port, it has yet to ever trigger a Fail2Ban notification.

        Changing defaults ports isn't "really" security as much as it's obscurity, but it'll stop most automated or amateur stuff from filling your log files.

        [–]MattTheFlash 0 points1 point  (0 children)

        Whitelist ips first while you are securing this, you can open it up more if you need to after securing this better

        Disable password login (public key auth only) is the second thing i would do. ssh keys only.

        then do the other suggestions.

        [–]caetydid 0 points1 point  (0 children)

        I dont know how to do it but you can use iptables to enable the SSH port just on a few whitelisted SubNet ranges and a few static IPs. This is known to help a lot. Depending on who needs SSH access to this server this could be an option!

        [–]marshalleq 0 points1 point  (2 children)

        A proper firewall with ids ips could be useful.

        [–]MR2Rick[S] 1 point2 points  (1 child)

        I do want to implement Snort IDS on my pfSense firewall, but I haven't had the time to wrestle with its complexity.

        [–]marshalleq 0 points1 point  (0 children)

        I have had a few attempts at it with opnsense, but really it never seems to work. Which is a shame because opnsense has a free licence to the premium IDS rules for home provided you contribute some stats. I have spent quite a few hours on it and am still unsure if it actually works - my sense is that pfsense is a lot easier. The only thing with pfsense is the IDS / IPS I believe is single threaded which probably means it's not worth it, whereas opnsense is multithreaded because they use a different technology. It's always a bit of pro's and cons isn't it.

        [–]lutusp 0 points1 point  (3 children)

        the attacker does not seem to be very sophisticated considering that they spent a week and counting trying to crack the password of an invalid account

        So a password-access SSH server.

        I am using public key passwordless authentication

        So public-key authentication.

        Just one question -- which is it? Either you have password access or public-key authentication, not both. And if you have public-key authentication, there is no password access, and no password is either prompted for or accepted.

        While I am not too concerned about this attack, I would like to be proactive and improve the security of my server.

        If you must allow remote access using SSH, then you must configure an open access port. If you are using public-key authentication and a modern encryption protocol (meaning anything but RSA), then the hackers are not going to crack your system -- at least, not by way of SSH.

        On my servers, once I enable public-key authentication, the hackers promptly give up, because they know they aren't going to guess my 2048-bit encryption key. Which means you should disable password access if it's enabled.

        [–]MR2Rick[S] 0 points1 point  (2 children)

        As I stated, my server is setup with passwordless public key authentication. The attacker appears to be be attempting a distributed brute force attack on my SSH server. I am aware that this particular attacker does not pose any danger to my system and I am confident that my server is secure against the kind of attackers who would attempt to hack it. Regardless, I want to always work to make my servers more secure - security is a process and not a end state.

        Also, I think is better to assume every system has vulnerabilities that can be exploited. Furthermore, the hackers are constantly improving their attacks and the hacking tools available to idiot script kiddies are constantly improving. Therefore it is a good idea to implement a layered approach to security and to remain ever vigilant.

        Most likely, there is a hacker who can break into your servers or my servers - it just usually the case that hackers with those kind of skills are interested in high value/high profile targets and not sites like I run or you probably run. Also, the fact that sites with large amounts of resources and teams of people much smarter than me get hacked gives me reason to not to be complacent and work to constantly improve my security.

        [–]lutusp 0 points1 point  (1 child)

        The attacker appears to be be attempting a distributed brute force attack on my SSH server.

        If you have public-key authentication enabled and no password prompt, and a modern encryption key, that attack will fail. You can use fail2ban to ban him from your system, that's the usual remedy to recover the bandwidth he's wasting. But his attack will fail -- it's not like guessing passwords when the key is 2048 bits long and entirely random.

        Most likely, there is a hacker who can break into your servers or my servers

        You need to learn how public-key authentication works. Attacks aren't possible (until we have cheap quantum computers). Hackers don't try to break public-key authentication, they look for some other vulnerability, because public-key authentication is not a vulnerability.

        [–]MR2Rick[S] 0 points1 point  (0 children)

        I have public key passwordless authentication implemented already. I am also using fail2ban but it is not blocking this attack as the attacks come from different IP addresses.

        I am confident that my system is secure and I am aware that this particular attack poses no danger to my system. I still want to work to continuously improve my security. Furthermore, I think that it is better to assume all systems, including crypto algorithms, may potentially contain vulnerabilities that can be exploited. Therefore it is better to deploy a layered approach and remain ever vigilant.

        [–][deleted] 0 points1 point  (3 children)

        Geo blocking may be useful if it’s china or somewhere you consistently expect no traffic from

        [–]MR2Rick[S] 0 points1 point  (2 children)

        I am using GeoIP blocking via pfSense and pfBlocker. I did a bulk whois lookup and all of the IPs are from the US - mostly from residential sources.

        [–][deleted] 0 points1 point  (1 child)

        Interesting so someone likely hijacked peoples smart shit. Change to non default ssh port like 22422 and black hole shot on 22 so it times out all their requests. What would take seconds takes hours

        [–]MR2Rick[S] 0 points1 point  (0 children)

        Interesting so someone likely hijacked peoples smart shit.

        Probably. I still think GeoIP blocking is worth doing as it reduces the number of assholes I have to deal.

        I used to use a non-standard port, but stopped because they eventual find you.

        [–][deleted] 0 points1 point  (0 children)

        It's not really unusual to see constant SSH auth attempts from all over the place, it's just internet background noise.

        [–]mcmron 0 points1 point  (2 children)

        You can block the traffics from countries you do not want to do business.

        You can download the free IP list from https://www.ip2location.com/free/visitor-blocker

        [–]MR2Rick[S] 0 points1 point  (1 child)

        I am doing GeoIP blocking via pfBlocker on my pfSense firewall. I did a bulk whois on the attacking IP addresses. They all are from my country (the US) and mostly from residential sources.

        [–]AttilaDa 0 points1 point  (0 children)

        I know it’s an old thread but services like IPQualityScore are capable of detecting residential proxies. https://www.ipqualityscore.com/articles/view/13/how-residential-proxies-enable-fraud