What to do when an SSH session hangs because of a network problem

It’s a very basic post, yet still useful!

Sometimes when you disconnect from a network or VPN or have any network connectivity problem in general that affects an established SSH connection to any of your servers, the terminal hangs for quite a while and you most probably just close the terminal and open a new one!

To avoid this, just do the following:

  1. Press Enter
  2. Press Shift + ~
  3. Press .

And the session is terminated without having to close the terminal window, that’s it!

Enjoy!

Source: A comment on one of the StackOverflow posts that I can’t find right now!

About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Linux and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s