If your ssh client freezes after some inactive time, try adding
ServerAliveInterval 300
to your ssh_config.