Skip to content

Commit 588072a

Browse files
MichaIngmkj
authored andcommitted
Re-add host to "Login attempt for nonexistent user" log
#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 <[email protected]>
1 parent cdfda00 commit 588072a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/svr-auth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ static int checkusername(const char *username, unsigned int userlen) {
265265
if (!ses.authstate.pw_name) {
266266
TRACE(("leave checkusername: user '%s' doesn't exist", username))
267267
dropbear_log(LOG_WARNING,
268-
"Login attempt for nonexistent user");
268+
"Login attempt for nonexistent user from %s",
269+
svr_ses.addrstring);
269270
ses.authstate.checkusername_failed = 1;
270271
return DROPBEAR_FAILURE;
271272
}

0 commit comments

Comments
 (0)