how to make ssh putty retain connection even after vista is coming back from hibernation?

7

2

in Ubuntu, when i open up an ssh connection to my server, and i hibernate mode, when i restore, the ssh connection is still there. i can work on my server instantly.

in windows, when i open up an ssh connection, and i hibernate and restore , the ssh connection is dead.

it's rather annoying to have to connect and login every time i hibernate (which is often)

user33319

Posted 2010-04-06T00:13:35.117

Reputation:

Answers

3

Short answer: not possible. Long answer: When you put the computer into hibernation, Windows takes whatever is in the memory and saves it to the hard drive, and shuts down completely. This means that any connections are cut off, including SSH, and have to be started again when the computer is powered back on. You could probably set it to autoconnect when you turn the computer on again, but you'd still have to login and so on.

wizjany

Posted 2010-04-06T00:13:35.117

Reputation: 571

3

If you use screen on your server, at least you can resume the session when you log in again.

And if you use keys to log in instead of password, then you can autologin.

Perhaps even put screen -r in your login-script, so screen is automaqtically resumed.

Lenne

Posted 2010-04-06T00:13:35.117

Reputation: 1 163

3

Windows does seem to shut down all the TCP connections on hibernation, so you need to overcome its stupidity by tunneling your session over a connectionless protocol, such as UDP. Just pick any of countless VPNs that can do this.

Edit: There is another solution: have a Linux in VMware, and ssh from it to your server. But it works only with VMware network adapter option set to "bridged". If you use "NAT", the connection will be dropped by the Windows host.

I have merged the solutions above and have set up an OpenVPN tunnel between my Windows XP host and Linux guest. Now I can use PuTTY to connect to my Linux host, and ssh anywhere from there - and no connection is dropped when I hibernate the machine. One important thing to remember when using OpenVPN is to change "Media Status" option of TAP-Win32 Adapter - the default is "Application Controlled", and it needs to be "Always Connected". Whole setup is a bit tricky, but a few hours I spent on finding out how to do it should be worth it - no more "Network error: Software caused connection abort", yay.

Edit2: The above can be simplified a bit, it isn't necessary to set up a VPN, we just need a VMware with two interfaces: one set to "bridged", and one set to "host-only". Connect to the Linux guest using host-only interface and then ssh outside using bridged interface. Works as expected.

michau

Posted 2010-04-06T00:13:35.117

Reputation: 158