Skip to content

Commit

Permalink
Re-add host to "Login attempt for nonexistent user" log
Browse files Browse the repository at this point in the history
#83 removed the host from the final message part of early exit messages, and added it to the initial message part instead. This was however done for "Login attempt for nonexistent user" as well, which is no early exit message, but allows the client to keep trying. Those log entries hence now do not contain a host anymore.

This PR reverts this part of #83 to restore the missing host, and re-enable software like Fail2Ban to track these login failures.

Signed-off-by: MichaIng <micha@dietpi.com>
  • Loading branch information
MichaIng committed Jul 10, 2024
1 parent 2674736 commit 45a5cb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/svr-auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ static int checkusername(const char *username, unsigned int userlen) {
if (!ses.authstate.pw_name) {
TRACE(("leave checkusername: user '%s' doesn't exist", username))
dropbear_log(LOG_WARNING,
"Login attempt for nonexistent user");
"Login attempt for nonexistent user from %s",
svr_ses.addrstring);
ses.authstate.checkusername_failed = 1;
return DROPBEAR_FAILURE;
}
Expand Down

0 comments on commit 45a5cb3

Please sign in to comment.