diff options
author | Eric Lesiuta <elesiuta@gmail.com> | 2020-12-08 12:54:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 18:54:33 +0100 |
commit | abb9cffe4a9b36c124b1ef8fad4a00eff4ba36de (patch) | |
tree | c2700e2ee86ac70a5f50979aed172f3de197d3dc /modules/ssh/ssh.go | |
parent | 42354dfe45fa0cabb59674b896c44a55a56cf163 (diff) | |
download | gitea-abb9cffe4a9b36c124b1ef8fad4a00eff4ba36de.tar.gz gitea-abb9cffe4a9b36c124b1ef8fad4a00eff4ba36de.zip |
Log IP on SSH authentication failure for Built-in SSH server (#13150)
* Log IP on SSH authentication failure
fixes https://github.com/go-gitea/gitea/issues/13094
* include string 'Failed authentication attempt' in error
* update fail2ban docs
also match failed authentication over command line
* better logging of authentication errors with IP addresses
* format ...
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/ssh/ssh.go')
-rw-r--r-- | modules/ssh/ssh.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index 761164caa0..9bfa39ef42 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -186,7 +186,7 @@ func publicKeyHandler(ctx ssh.Context, key ssh.PublicKey) bool { pkey, err := models.SearchPublicKeyByContent(strings.TrimSpace(string(gossh.MarshalAuthorizedKey(key)))) if err != nil { - log.Error("SearchPublicKeyByContent: %v", err) + log.Error("SearchPublicKeyByContent: %v Failed authentication attempt from %s", err, ctx.RemoteAddr()) return false } |