Depending on the environment you're working in, you may be automatically logged out from a server by SSH timeouts. Here are a few things you can do to help prevent these timeouts :
Add or modify the following in your /etc/ssh/sshd_config file :
In your ~/.bashrc file, set the TMOUT parameter to something longer. For example :
On your client (PuTTY) set the seconds between keepalives to something like 30.