How To Keep SSH Alive In MacOSX Lion Terminal Sessions
Apple’s 10.7 Lion, is NOT my favorite iteration of MacOSX. They continue to make the OS more Windows-like, which means they have started down that slippery slope…
In Snow Leopard, I could have my ssh sessions running for weeks. In Lion, the ssh sessions time out with nasty errors, including “Write failed: Broken pipe”. After much research and testing, my solution was to create a file called ~/.ssh/config
containing the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# Stop timing out connections ServerAliveInterval 30 ServerAliveCountMax 20 # SSH Connection pooling for faster additional connections to a machine ControlMaster auto ControlPath /tmp/ssh_mux_%h_%p_%r # This makes subsequent connections go faster ControlPersist 2h # Make it so ssh-ing from one server to another passes keys around automagically Host * ForwardAgent yes # Get rid of SSH connection delays GSSAPIAuthentication no # Use less encryption on servers I cant get to off-network Host 10.* 172.* 192.168.* Ciphers blowfish-cbc |
ron said on August 23, 2012, 8:26 am:
Great! That fixed my ssh broken pipe error immediately. Wonderful.