I'd noticed that when ssh'ed into my Media Temple server, if I left the terminal alone for a while (a minute or two), when I came back the connection would be frozen and I'd have to close the terminal.
I searched for a resolution and found it here.
I created a file in my ~/.ssh folder called config
and added the following:
ServerAliveCountMax 3
ServerAliveInterval 10
Solved the problem for me.