tmux
The problem with ssh sessions is that they are not persistent. Once you lose your internet connection, the ssh session will disconnect and usually all programs started inside the ssh session will terminate.1
tmux
2 is a program that helps with that.
Minimalist guide to tmux
- Log in to a server with ssh
-
see if there are any
tmux
sessions active:tmux list-sessions
-
If there are no sessions, start a new one:
tmux
-
Otherwise, attach to an existing session:
tmux attach
-
Run your programs as usual
-
There are tools such as
nohup
anddisown
(or the more modernsystemd-run
) that can be used to keep a program running even without a ssh connection, but they all share the problem that it is not possible to interact with the program once it has started running. ↩ -
A similar program is
screen
buttmux
is allegedly more modern. ↩