Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After a small hiccup in internet connection, any open PuTTY windows throw up a message box saying there was a connection error. Is there a way to automate retry attempts? Or better yet, tell it to watch the status of the network and reconnect when internet access is reestablished?

I know there's the "stackoverflow" solution of writing a program that invokes PuTTY using its command line interface using -load and -pw. But I'm looking for a "superuser" solution because that seems like less work.

Should I look into Tunnelier instead?

Background: I'm using an SSH tunnel with port forwarding to get remote access to a database on BlueHost.

share|improve this question

6 Answers 6

There's also a fork of PuTTY called PuTTY Tray which adds a "reconnect on connection failure" option (albeit experimental): https://puttytray.goeswhere.com/

share|improve this answer
    
Looks like it would also solve my problem. Thanks –  colithium Sep 20 '11 at 21:55
up vote 7 down vote accepted

Tunnelier provides the functionality I was seeking.

share|improve this answer

Kitty is a forked version of putty that adds reconnect, send to tray and stored username/password. The auto reconnect works after the machine awakes from sleep as well. It's been very stable for me. FREE :)

share|improve this answer

Might not be as useful or convenient for you as it is for me, but I use screen in my ssh sessions and it has the option of resuming and a broken connection with screen -R so long as you connect to the same server (my uni provide 3 servers which they can allocate or you can explicitly choose).

share|improve this answer

The only thing I can think of that might help is the "Enable TCP Keepalives" option under Connection.

share|improve this answer
    
See my comment on jfmessier's answer –  colithium Sep 15 '10 at 18:23

You might not be able to re-establish an EXISTING connection, as the shared key created during the connection, and renewed on a regular basis might get our of sync, or outdated. At this point, this would have to be re-initialised, using your own private key with the server.

Enable TCP Keepalives might be the only solution here.

share|improve this answer
    
My situation is: I use the connection rather frequently and it should never be idle for more than a minute. My issue is when the internet disconnects for a few seconds, so does my session. ServerAliveInterval and ServerAliveCountMax seem like they MIGHT work but I'm not sure how to configure those with PuTTY... –  colithium Sep 15 '10 at 18:23
    
Under PuTTY configuration, in the list on the left, click Connection. On the right, you will see items such as "Seconds between keepalives (0 to turn off)" 0 is the default value. You can also play with the Low-level TCP connection options. –  jfmessier Sep 16 '10 at 11:34
    
Key re-exchange requires acknowledgement from the other end... "out of sync" can't happen. –  grawity Oct 20 '10 at 10:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.