52

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.

0
35

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 :)

9
  • 5
    Download: fosshub.com/KiTTY.html
    – user956584
    Nov 21 '15 at 21:48
  • 5
    The auto reconnect options are on the middle of the "Connection" page under "Reconnect options". I wasn't sure at first if this feature was automatic or a setting
    – SeanDowney
    Dec 16 '15 at 18:46
  • 3
    The official site: kitty.9bis.net
    – Ouroborus
    Oct 16 '16 at 8:58
  • 1
    It is open source
    – Rolf
    Apr 5 '18 at 0:42
  • I cannot find where to specify auto reconnect in KiTTY, where is it? I am looking under "Connection" Feb 9 '20 at 19:44
14

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

3
  • Looks like it would also solve my problem. Thanks
    – colithium
    Sep 20 '11 at 21:55
  • 8
    BETA: 0.67-t029 (2016-06-26) Note: Automatic reconnection is deprecated. It doesn't work. Please disable it.
    – natenho
    Jul 21 '16 at 15:28
  • Can confirm, doesn't work. Too bad. :(
    – djk
    Jul 11 '17 at 14:02
13

Tunnelier provides the functionality I was seeking.

It is free:

Our client is free for use of all types, including in organizations.

1
  • 1
    Didn't it only be free for personal use? There was a 2GB file limit for the FTP to SCP bridge. Also Tunnelier is now called "Bitvise SSH Client" Feb 9 '20 at 19:46
4

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).

1
  • 1
    I use screen and it is very useful, however I have tunnels setup in KiTTY and would rather get auto reconnect there. I already have different settings in BitVise SSH Client. PuTTY, KiTTY can have multiple sessions. Feb 9 '20 at 19:47
3

You can use mutli tabbing putty http://ttyplus.com/multi-tabbed-putty/ which allows to reconnect the session back. Beside bringing the session back it allows multi tabbing.

0

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

1
  • See my comment on jfmessier's answer
    – colithium
    Sep 15 '10 at 18:23
0

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.

4
  • 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.
    – user1686
    Oct 20 '10 at 10:04
  • 3
    TCP keepalive or SSH keepalive null packets do not help to keep the connection open in case the communication is broken. Contrary these settings will help to realize that the communication is nonfunctional sooner and consequently bring the SSH connection down sooner. --- The keepalive messages are important in case there are long periods without communication - to keep the communication open on stateful devices (like dynamic NAT or firewall).
    – pabouk
    Nov 7 '17 at 14:03
0

You can use screen on the server side, and setup a passwordless auth to putty with a low timeout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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