add support for the venerable FTP protocol

Fixes #46
This commit is contained in:
Nicola Murino
2020-07-29 21:56:56 +02:00
parent cc2f04b0e4
commit 93ce96d011
38 changed files with 3075 additions and 160 deletions

View File

@@ -223,7 +223,7 @@ func (c Configuration) configureLoginBanner(serverConfig *ssh.ServerConfig, conf
return banner
}
} else {
logger.WarnToConsole("unable to read login banner file: %v", err)
logger.WarnToConsole("unable to read SFTPD login banner file: %v", err)
logger.Warn(logSender, "", "unable to read login banner file: %v", err)
}
}
@@ -269,6 +269,7 @@ func (c Configuration) AcceptInboundConnection(conn net.Conn, config *ssh.Server
logger.Warn(logSender, "", "failed to accept an incoming connection: %v", err)
if _, ok := err.(*ssh.ServerAuthError); !ok {
logger.ConnectionFailedLog("", utils.GetIPFromRemoteAddress(remoteAddr.String()), "no_auth_tryed", err.Error())
metrics.AddNoAuthTryed()
}
return
}
@@ -348,7 +349,7 @@ func (c Configuration) AcceptInboundConnection(conn net.Conn, config *ssh.Server
func (c Configuration) handleSftpConnection(channel ssh.Channel, connection *Connection) {
common.Connections.Add(connection)
defer common.Connections.Remove(connection)
defer common.Connections.Remove(connection.GetID())
// Create a new handler for the currently logged in user's server.
handler := c.createHandler(connection)