Skip to content

Commit 65b6ebf

Browse files
Whisprinzeripath
authored andcommitted
Log IP of failed ssh connection (#5766)
Fix #5765 by log the IP address of a connecting remote machine in case of a SSH connection error for the built-in ssh server. Signed-off-by: Robert Sprunk <[email protected]>
1 parent af45648 commit 65b6ebf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/ssh/ssh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ func listen(config *ssh.ServerConfig, host string, port int) {
135135
sConn, chans, reqs, err := ssh.NewServerConn(conn, config)
136136
if err != nil {
137137
if err == io.EOF {
138-
log.Warn("SSH: Handshaking was terminated: %v", err)
138+
log.Warn("SSH: Handshaking with %s was terminated: %v", conn.RemoteAddr(), err)
139139
} else {
140-
log.Error(3, "SSH: Error on handshaking: %v", err)
140+
log.Error(3, "SSH: Error on handshaking with %s: %v", conn.RemoteAddr(), err)
141141
}
142142
return
143143
}

0 commit comments

Comments
 (0)