LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-26-2022, 07:55 AM   #1
RickPoleshuck
Member
 
Registered: Jun 2019
Posts: 30

Rep: Reputation: Disabled
Received disconnect: Bye Bye [preauth]


My logwatch report shows this in the SSHD section:

Received disconnect:
Bye Bye [preauth] : 6004 Times

Can someone tell me what this means?

Thanks
 
Old 12-27-2022, 12:58 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
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.
 
Old 12-27-2022, 06:29 AM   #3
RickPoleshuck
Member
 
Registered: Jun 2019
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
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.

Thanks again
 
Old 12-27-2022, 06:45 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
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.
 
Old 12-27-2022, 07:10 AM   #5
RickPoleshuck
Member
 
Registered: Jun 2019
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fatal: Access denied for user by PAM account configuration [preauth] cp24eva Linux - Newbie 1 05-15-2017 02:30 PM
Strange SSH brute force (many "Received disconnect [preauth]") simopal6 Linux - Security 5 11-04-2012 01:26 AM
Bye, Bye long filenames garymck3 Linux - Newbie 2 03-30-2003 02:50 PM
Bye, bye NSKL General 12 07-10-2002 07:59 PM
bye bye windows? Nelleh Linux - Newbie 2 05-09-2002 05:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration