Common tmux commands for keeping long-running jobs alive over SSH during pentests.
Tmux keeps a terminal session running on a remote box even after you disconnect. This is useful during a pentest when you SSH into a host and want a long-running command (a scan, a brute force, a reverse shell listener) to survive a dropped connection.
Detach and reattach a session
ssh username@remote_hosttmuxyour_commandInside the tmux session, press Ctrl-b then d to detach and close your SSH connection. When you reconnect, reattach with:
tmux attach -t 0Manage windows
Ctrl-b c # Create a new window in the current sessionCtrl-b 0-9 # Switch to window 0-9



