SSH.NET 执行需要很长时间才能完成的命令时连接中止

SSH.NET connection aborts when executing a command that takes long time to finish

当我尝试 运行 一个通常需要超过 30 分钟才能完成的命令时,SSH.NET 出错:

Error source:SSH Run Command . Error message:An established connection was aborted by the server.

尝试设置 SshClient.KeepAliveInterval:

client.KeepAliveInterval = TimeSpan.FromMinutes(1);