You can use nohup
to prevent a job from being killed when the shell that spawned it exits, eg:
(the ampersand puts it in the background, the output is directed to nohup.out).
You can also use disown
to disown a process that is already running (again, so that the shell exit does not kill the child process).
A more versatile way is to use screen
to create terminal sessions that can be disconnected and reconnected.