Working remote on your Linux system through ssh requires for some actions which take long that you keep your session en terminal open for a long time. To overcome this need there is a nice tool called screen. This enables use to detach a session from the terminal and re-attach it later. It provides the possibility to shutdown your ssh session and keep the process running. At a later point in time you can start a new ssh session from anywhere and re-attach the process.
To install on Raspbian just execute
sudo apt-get install screen
To use it
To detach the process press Ctrl-A d
To re-attach the screen
sudo screen -r
To see all screens
sudo screen -ls
To re-attach a specific screen
sudo screen -r 7849 , where 7849 is the screen ‘process’ number
A much better how-to can be found here.