@@ -339,6 +339,8 @@ func (i *CmxInstance) CommandWithEnv(
339339 "-i" , "/root/.ssh/id_rsa" ,
340340 "-o" , "StrictHostKeyChecking=no" ,
341341 "-o" , "BatchMode=yes" ,
342+ "-o" , "ServerAliveInterval=60" ,
343+ "-o" , "ServerAliveCountMax=10" ,
342344 "-p" , fmt .Sprintf ("%d" , i .SSHPort ),
343345 fmt .Sprintf ("%s@%s" , i .SSHUser , i .SSHEndpoint ),
344346 remoteCmd ,
@@ -382,6 +384,8 @@ func (i *CmxInstance) UploadFile(
382384 "-i" , "/root/.ssh/id_rsa" ,
383385 "-o" , "StrictHostKeyChecking=no" ,
384386 "-o" , "BatchMode=yes" ,
387+ "-o" , "ServerAliveInterval=60" ,
388+ "-o" , "ServerAliveCountMax=10" ,
385389 "-P" , fmt .Sprintf ("%d" , i .SSHPort ),
386390 tempPath ,
387391 fmt .Sprintf ("%s@%s:%s" , i .SSHUser , i .SSHEndpoint , tmpDest ),
@@ -677,6 +681,8 @@ func (i *CmxInstance) DownloadFile(
677681 "-i" , "/root/.ssh/id_rsa" ,
678682 "-o" , "StrictHostKeyChecking=no" ,
679683 "-o" , "BatchMode=yes" ,
684+ "-o" , "ServerAliveInterval=60" ,
685+ "-o" , "ServerAliveCountMax=10" ,
680686 "-P" , fmt .Sprintf ("%d" , i .SSHPort ),
681687 fmt .Sprintf ("%s@%s:%s" , i .SSHUser , i .SSHEndpoint , remotePath ),
682688 localPath ,
0 commit comments