0

I'm using Mac, but I don't know if this matters. Anyway:

  1. In Terminal, do SSH to a remote host.
  2. Close lid. (The network connection is cut off at this point).
  3. Wait. Open lid again.

Some times, the terminal still thinks it's connected to the remote host and the cursor is inanimate.

How can I end the remote connection and regain control over my parent shell? Pressing Ctrl+C does nothing.

0

It should be possible to either terminate the connection by typing ~., or to kill the "dead" ssh program by typing ~Ctrl+z, ~ being the special character to "escape" the following control sequence, and Ctrl+z then sends the ssh process to the background. Then you can kill it with kill %1.

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.