7

Ubuntu 16.04.

My terminal freezes, as the title says. I know it's an ssh session, however I would expect only to drop me off, but the whole terminal freezes, no mouse nor keyboard input is possible.

Does anybody know a solution?

2
  • 5
    In the terminal with the hanging SSH session you could try the following key-sequence which will close the connection. ~, then shortly afterwards .
    – Thomas
    May 22 '17 at 9:59
  • Seems does not work all the time. Sometimes it does.
    – MattSom
    May 30 '17 at 13:20
5

For the SSH escape sequences to work you need to be on a newline, so hit the RETURN key first.

Then usage of eg ~. (terminate connection) will work.

To see all supported escape sequences use ~? in a SSH session:

Supported escape sequences:
 ~.   - terminate connection (and any multiplexed sessions)
 ~B   - send a BREAK to the remote system
 ~C   - open a command line
 ~R   - request rekey
 ~V/v - decrease/increase verbosity (LogLevel)
 ~^Z  - suspend ssh
 ~#   - list forwarded connections
 ~&   - background ssh (when waiting for connections to terminate)
 ~?   - this message
 ~~   - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.