17
My SSH session disconnects and kills my running processes. How can I keep them running?
Loading...
Q&A · Answered
My SSH session disconnects and kills my running processes. How can I keep them running?
Accepted answer
# Using screen
screen -S mysession # Create session
# Run your commands
Ctrl+A, D # Detach
screen -r mysession # Reattach
# Using tmux (recommended)
tmux new -s mysession # Create
# Run commands
Ctrl+B, D # Detach
tmux attach -t mysession # Reattach
# List sessions
tmux ls
screen -lsSay what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.