If a SSH shell dies (from timeout for example), you cannot kill it with the usual CTRL-C or CTRL-Z. Instead, press [ENTER]~. (That is ENTER TILDE PERIOD).
CTRL-C
CTRL-Z
ENTER TILDE PERIOD