GNU Screen is a fantastic piece of software when working with only an SSH connection.

It allows you to run multiple virtual terminals in a single window, but most importantly allows you to detach from the session. By this I mean you detach from the screen session, close your SSH sessions and whatever was running in the terminal remains running. You can then SSH back in at a later date, reconnect to the screen session and be right back where you were. Brilliant for any long running jobs like large compiles when you don't want to keep the SSH session running.

For more details take a look here