On my home WiFi connection, I occasionally find my SSH sessions being stuck and completely unresponsive. The only way to resolve the issue has been to close the window of the terminal emulator, which is usually no big deal. This becomes more of an issue when using ChromeOS on my CR48 where you can't close the shell window by any means other than the "exit" command. Prior to discovering a more graceful solution, I had been using this somewhat lengthy workaround (which requires ChromeOS to be in dev mode):
Killing the process manually is not ideal, especially when your WiFi drops whenever the router yawns.
This solution that is built into the standard openSSH client takes a lot less time and closes the connection as opposed to just killing the client process. When the session is stuck, press the following keys to close the SSH connection:
- Press Alt-Ctrl-T to open a new crosh shell.
- Type "shell" to open a Linux shell.
- Run "ps fax | grep ssh" to find the process id of the stuck ssh session.
- Kill the stuck session with "kill -9 [process ID]"
That's it! Your connection will be closed with the "Connection to [host] closed" message. I hope that you find this tip as useful as I did. Happy hacking!
- Tilde ( "~" / shift back-tick )