Skip to content

Commit 95d5840

Browse files
committed
include string 'Failed authentication attempt' in error
1 parent 719999a commit 95d5840

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/ssh/ssh.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ func sessionHandler(session ssh.Session) {
124124
// Wait for the command to exit and log any errors we get
125125
err = cmd.Wait()
126126
if err != nil {
127-
log.Error("SSH: Wait: %v from %s", err, session.RemoteAddr())
127+
log.Error("SSH: Wait: %v Failed authentication attempt from %s", err, session.RemoteAddr())
128128
}
129129

130130
if err := session.Exit(getExitStatusFromError(err)); err != nil {
131-
log.Error("Session failed to exit. %s from %s", err, session.RemoteAddr())
131+
log.Error("Session failed to exit. %s Failed authentication attempt from %s", err, session.RemoteAddr())
132132
}
133133
}
134134

@@ -185,7 +185,7 @@ func publicKeyHandler(ctx ssh.Context, key ssh.PublicKey) bool {
185185

186186
pkey, err := models.SearchPublicKeyByContent(strings.TrimSpace(string(gossh.MarshalAuthorizedKey(key))))
187187
if err != nil {
188-
log.Error("SearchPublicKeyByContent: %v from %s", err, ctx.RemoteAddr())
188+
log.Error("SearchPublicKeyByContent: %v Failed authentication attempt from %s", err, ctx.RemoteAddr())
189189
return false
190190
}
191191

0 commit comments

Comments
 (0)