[X4U] ssh connection hangs terminal

John Masters johnmasters at me.com
Mon Nov 10 13:11:56 PST 2008


On 8 Nov 2008, at 07:06, David Ledger wrote:

>> From: John Masters <johnmasters at me.com>
>> I have a VPS which I admin via ssh using ssh keys. When I ran Linux I
>> would ssh-add the key, connect to the server and it would stay
>> connected for weeks without problems. Could keep a term open for Mutt
>> to read mail without a worry.
>> Connecting to the same server from my iMac things get a little  
>> flakey.
>> If the connection is left open for any length of time (I haven't yet
>> determined how long but it is less than 2 hours) the connection is
>> lost, but worse, the terminal hangs. No response to keyboard. I can
>> close the terminal and reopen but I then have to redo my ssh-add.
>> Following on from that, assuming I can find a cure, how can I keep  
>> the
>> session alive if I sleep my Mac? Do I set the ServerAliveCountMax in
>> ssh_config to infinity or set the ServerAliveInterval to some huge
>> number of seconds?
>
> One of my ISPs allows ssh access and I can stay connected for days  
> on end (17" G4 PB and Intel mini, both running latest Leopard).  
> Connections survive sleep. Not done anything special that I'm aware  
> of. Maybe the other end is ignoring an inactive connection but not  
> closing it - hence the hang.
>
> David
>

I didn't think it was the server but to be certain I set up a Linux VM  
in VMWare Fusion and set up ssh to connect to the same server.  
Generated a dsa key and appended it to ~/.ssh/authorized_keys2 on my  
server. Can connect to the server OK and the connection stays up for  
hours.

The connection on my Mac drops after exactly one hour. AFAICT there is  
no significant difference between the two sshd_config files so where  
is the problem?

-- 
Regards, john


More information about the X4U mailing list