With screen one can detach from an ssh session without interrupting the current execution, and later on it is easy to reattach and see what has happened.
Usage
Start it with:
$ screen
Detach:
$ <CTRL+a d >
Reattach:
$ screen -r
Reattach when multiple sessions:
$ screen -r <sid>
List running sessions:
$ screen -ls