Show user info, remove some extraneous connection ids

Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be>
This commit is contained in:
Jo Vandeginste
2019-09-05 16:46:50 +02:00
committed by drakkan
parent 0737c672f5
commit bb589c6fc8
2 changed files with 9 additions and 8 deletions

View File

@@ -230,6 +230,8 @@ func (c Configuration) AcceptInboundConnection(conn net.Conn, config *ssh.Server
lock: new(sync.Mutex),
sshConn: sconn,
}
logger.Info(logSender, connectionID, "User id: %d, name: %#v, home_dir: %#v",
user.ID, user.Username, user.HomeDir)
go ssh.DiscardRequests(reqs)
@@ -296,10 +298,10 @@ func (c Configuration) handleSftpConnection(channel io.ReadWriteCloser, connecti
server := sftp.NewRequestServer(channel, handler)
if err := server.Serve(); err == io.EOF {
logger.Debug(logSender, connection.ID, "connection closed, id: %v", connection.ID)
logger.Debug(logSender, connection.ID, "connection closed")
server.Close()
} else if err != nil {
logger.Error(logSender, connection.ID, "sftp connection closed with error id %v: %v", connection.ID, err)
logger.Error(logSender, connection.ID, "sftp connection closed with error: %v", err)
}
removeConnection(connection.ID)