如何让命令继续执行,即使 ssh 连接断开?
当使用SSH连接时,有时候希望即使连接断开,命令仍然能够继续运行。为了解决这个问题,可以使用nohup
命令。
根据在Google上的搜索结果,有3篇SO(Stack Overflow)的帖子可以帮助解决这个问题。这些帖子分别是:
- [Linux: Prevent a background process from being stopped after closing SSH client](https://stackoverflow.com/questions/285015)
- [Getting ssh to execute a command in the background on target machine](https://stackoverflow.com/questions/29142)
- [Use SSH to start a background process on a remote server, and exit session](https://stackoverflow.com/questions/19996089)
简而言之,可以使用nohup
命令。