I've had trouble using Emacs to edit remotely via SSH/tramp, but the following ~/.ssh/config settings helped me a lot:
# stop ssh connections from freezing
KeepAlive yes
ServerAliveCountMax 10
ServerAliveInterval 10
# Lets you bounce through an arbitrary number of hosts.
# ex: ssh 1sthost/2ndhost/3rdhost
Host */*
ProxyCommand ssh $(dirname %h) nc -w1 $(basename %h) %p
I keep thinking that what I really need is to switch all the machines I use to Plan9 to abstract away the remote sessions, I guess then I'd have to learn Acme :)