Google compute engine 在google计算引擎中保持活动后台进程

Google compute engine 在google计算引擎中保持活动后台进程,google-compute-engine,Google Compute Engine,我正在谷歌云上运行几个ubuntu实例。 使用以下命令为我拥有的每个小型服务器创建每个实例的ssh隧道: gcloud compute ssh --ssh-flag=-vvv "mini-server-1" --zone="us-central1-f" --ssh-flag="-D:5551" --ssh-flag="-N" --ssh-flag="-n" --ssh-flag="-4" --ssh-flag="-o" --ssh-flag="ServerAliveInterval=5" --s

我正在谷歌云上运行几个ubuntu实例。 使用以下命令为我拥有的每个小型服务器创建每个实例的ssh隧道:

gcloud compute ssh --ssh-flag=-vvv "mini-server-1" --zone="us-central1-f" --ssh-flag="-D:5551" --ssh-flag="-N" --ssh-flag="-n" --ssh-flag="-4" --ssh-flag="-o" --ssh-flag="ServerAliveInterval=5" --ssh-flag="-o" --ssh-flag="ServerAliveCountMax=100000" &
一切正常,我甚至添加了cron作业来检查连接是否每10分钟超时并重新启动。但当我退出时,似乎每个隧道都死了。脚本重新启动连接,我可以从日志中看到,但是当我重新登录时,
ps-af | grepsh
没有显示任何内容


有没有办法让永久通道在注销时不会死掉?

只需按Ctrl+D键退出,这个过程就不会死掉。

我想知道答案…@Elad663我用AutoSH软件包解决了这个问题,查看此帖子谢谢。我希望你能找到一个gcloud命令来做这件事。和其他hpc一样。我去看看。目前我使用屏幕。。