summaryrefslogtreecommitdiffstats
path: root/modules/ssh
diff options
context:
space:
mode:
authorRobert Sprunk <github@sprunk.me>2019-01-19 17:29:17 +0100
committerzeripath <art27@cantab.net>2019-01-19 16:29:17 +0000
commit65b6ebf24392efd30b087b33d9666fbaa821f2a2 (patch)
treed89ac282025cf25f9fae9d937832e90a1d9f0cd8 /modules/ssh
parentaf45648e260bdd84328e0125a2c16164fc903cbf (diff)
downloadgitea-65b6ebf24392efd30b087b33d9666fbaa821f2a2.tar.gz
gitea-65b6ebf24392efd30b087b33d9666fbaa821f2a2.zip
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 <github@sprunk.me>
Diffstat (limited to 'modules/ssh')
-rw-r--r--modules/ssh/ssh.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go
index aea46daad4..9b9c21278e 100644
--- a/modules/ssh/ssh.go
+++ b/modules/ssh/ssh.go
@@ -135,9 +135,9 @@ func listen(config *ssh.ServerConfig, host string, port int) {
sConn, chans, reqs, err := ssh.NewServerConn(conn, config)
if err != nil {
if err == io.EOF {
- log.Warn("SSH: Handshaking was terminated: %v", err)
+ log.Warn("SSH: Handshaking with %s was terminated: %v", conn.RemoteAddr(), err)
} else {
- log.Error(3, "SSH: Error on handshaking: %v", err)
+ log.Error(3, "SSH: Error on handshaking with %s: %v", conn.RemoteAddr(), err)
}
return
}