Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It can mean a lot of things but probably some scanner connected and then disconnected after receiving the banner. You can try with netcat and see:
Code:
nc yoursite.example.com 22
You might consider using SSHGuard, or Fail2Ban, plus NFTables. Fail2Ban has the name recognition but SSHGuard seems more capable. If you have IPv6, your choice will have to be SSHGuard plus NFTables. Despite the name it can handle other services as well such as HTTP not just SSH.
It can mean a lot of things but probably some scanner connected and then disconnected after receiving the banner. You can try with netcat and see:
Code:
nc yoursite.example.com 22
You might consider using SSHGuard, or Fail2Ban, plus NFTables. Fail2Ban has the name recognition but SSHGuard seems more capable. If you have IPv6, your choice will have to be SSHGuard plus NFTables. Despite the name it can handle other services as well such as HTTP not just SSH.
Thanks
I do use fail2ban, do not support ipv6, and do not use the default ssh port.
Reviewing my auth.log for today, I see "Received disconnect from Bye Bye [preauth]" from 429 unique IPs. It looks like I should add another fail2ban filter and rule. I am a little disappointed that fail2ban didn't come with this rule by default. Is that what you mean by "SSHGuard seems more capable"? Writing another fail2ban rule seems a lot easier than switching to SSHGuard. This will not be my first fail2ban custom filter and rule.
What I am seeing is that they are scanning all my ports, but logwatch only reports on my ssh port.
Yes, all ports on all outward facing systems get scanned more or less continuously so that won't hide your SSH service even a little bit. These days it doesn't even quiet the logs as much as it used to. Using keys and turning off password authentication seems to do the most in that regard as many bots seem to figure that out and not waste further effort against such systems.
Check Shodan for your IPv4 address. You'll find your router listed there along with whatever port you happen to have SSH on.
Adding a filter rule would only be relevant if the same addresses keep returning.
Yes, all ports on all outward facing systems get scanned more or less continuously so that won't hide your SSH service even a little bit. These days it doesn't even quiet the logs as much as it used to. Using keys and turning off password authentication seems to do the most in that regard as many bots seem to figure that out and not waste further effort against such systems.
Check Shodan for your IPv4 address. You'll find your router listed there along with whatever port you happen to have SSH on.
Adding a filter rule would only be relevant if the same addresses keep returning.
Again, just looking at this morning's log, 362 ip addresses have 30 attacks each. So yes, I think a new fail2ban rule is recommended. I do have a honeypot on an otherwise unused port that I thought would stop a lot of scanning, but now I think a fail2ban filter on 'Disconnected.*preauth' is a better solution.
Looking up my server in Shodan was VERY interesting. Much thanks.
Of course I only use public key authentication, but it is good to recommend to other readers of this thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.