mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -135,9 +135,9 @@ func listen(config *ssh.ServerConfig, host string, port int) {
 | 
				
			|||||||
			sConn, chans, reqs, err := ssh.NewServerConn(conn, config)
 | 
								sConn, chans, reqs, err := ssh.NewServerConn(conn, config)
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
				if err == io.EOF {
 | 
									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 {
 | 
									} else {
 | 
				
			||||||
					log.Error(3, "SSH: Error on handshaking: %v", err)
 | 
										log.Error(3, "SSH: Error on handshaking with %s: %v", conn.RemoteAddr(), err)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user