diff --git a/pkg/handler/server_ssh.go b/pkg/handler/server_ssh.go index ed51a6bc..1b4fcaa1 100644 --- a/pkg/handler/server_ssh.go +++ b/pkg/handler/server_ssh.go @@ -412,7 +412,7 @@ func (s *Server) proxyAssetCommand(sess ssh.Session, sshClient *srvconn.SSHClien } ctx, cancel := context.WithCancel(sess.Context()) defer cancel() - + respSession.TokenId = tokenInfo.Id traceSession := session.NewSession(&respSession, func(task *model.TerminalTask) error { switch task.Name { case model.TaskKillSession: diff --git a/pkg/srvconn/sftp_asset.go b/pkg/srvconn/sftp_asset.go index c42b8e2e..db383dc5 100644 --- a/pkg/srvconn/sftp_asset.go +++ b/pkg/srvconn/sftp_asset.go @@ -575,6 +575,7 @@ func (ad *AssetDir) createSftpSession(su *model.PermAccount) (sftpSess *SftpSess logger.Errorf("Create sftp Session err: %s", err1.Error()) return nil, err1 } + respSession.TokenId = conn.token.Id sftpSession := &SftpSession{SftpConn: conn, sess: &respSession, jmsService: ad.jmsService} terminalFunc := func(task *model.TerminalTask) error { switch task.Name {