What is the best way to enable a command running in screen on a first machine to continue to be able to run commands on a second machine after I am no longer connected to the first?
Here is the background. I have a long running command which needs to regularly collect information from other machines. It does this by sending ssh commands and reading the output. This currently works through ssh agents because I logged in with ForwardAgent
.
Currently I can ssh to the first machine, run the command, and it works. Likewise I can start a screen, run the command, disconnect from screen, and it continues running. But if my ssh connection to the first machine breaks, then the ssh agent stops working and the command running in the screen breaks.
I would like the command to be able to run correctly even though I am no longer connected to either machine.