From deef8162b16ba64eedb09d3a6fc65a29887ecbaf Mon Sep 17 00:00:00 2001 From: ttk Date: Thu, 30 May 2024 14:22:09 +0800 Subject: [PATCH] fix: set timeout 3s --- backend/pkg/server/controller/connect.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/pkg/server/controller/connect.go b/backend/pkg/server/controller/connect.go index cc9545e..4611b97 100644 --- a/backend/pkg/server/controller/connect.go +++ b/backend/pkg/server/controller/connect.go @@ -318,6 +318,7 @@ func connectSsh(ctx *gin.Context, req *gsession.SshReq, chs *gsession.SessionCha ssh.Password(conf.Cfg.SshServer.Password), }, HostKeyCallback: ssh.InsecureIgnoreHostKey(), + Timeout: time.Second * 3, } conn, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", conf.Cfg.SshServer.Ip, conf.Cfg.SshServer.Port), cfg) if err != nil {