How to terminate a SSH connection that does not respond to CTRL+C
If a SSH connection is stuck and no longer responds to CTRL+C, try using the built-in escape sequences. First send a tilde (~) followed by a dot (.). Normally this should stop the connection.
When using escape sequences, you should not see the tilde and dot. If that happens, press first enter, so the client is a state where escape sequences can be used.