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

Solution 1:

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.

Solution 2:

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.