Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am a new user to OS X (MacBook Air, 10.6.7) migrating from Ubuntu and extremely happy with it. I use terminator running on X11 for my terminal program, and I'm using SSH: OpenSSH_5.8p1, OpenSSL 1.0.0d 8 Feb 2011

My problem is that when tunnelblick VPNs reconnect all my SSH sessions hang and I must close the terminal and re-open it. In Ubuntu what would happen is the sessions would automatically continue working again once the VPN connection was re-established.

Is there any way to make it so these connections re-establish once the VPN is back up? Occasionally my VPN hiccups and its annoying to close all my windows. I'm aware I could use screen but it doesn't really solve the problem as easily as it was working under Ubuntu.

share|improve this question
3  
probably you're being assigned a new ip address, that's why the ssh connections freeze.. :/ –  nuc Apr 13 '11 at 15:33
    
Ah, I've suffered from the exact same feature and thought it was a bug in Transmit (which froze when I prematurely shut down VPN-connection while using SFTP, which required the VPN). Even reported it, as shutting the VPN didn't affect other connections and I thought reconnecting should help in the same manner as in Ubuntu. –  koiyu Apr 13 '11 at 16:04

1 Answer 1

Unfortunately, I think each VPN client will be picky about this in its own way. Since the network is dropping from underneath the SSH connection, you will have three scenarios that could cause it to "hang", or just drop (that I can think of).

  1. Data is flowing back and forth, and the connection is gone.
  2. You get a new IP address when reconnecting.
  3. Timeout/Alive conditions trigger before you reconnect.

2 Suggestions...

  1. Use screen (you said you don't want to do this, I know, but it really is the most robust solution. There are scripts out there that can greatly enhance/automate the reconnection process).
  2. Compare your SSH configurations. Usually stored in /etc/ssh_config or similiar.

BTW -- I don't think you should need to close windows, just do "~ ." (tilde dot). Tilde is used to control the ssh session. See the manpage for more details.

share|improve this answer

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.