How To Keep SSH Alive In MacOSX Lion Terminal Sessions

Published Date Author: , Posted May 24th, 2012 at 10:18:47am

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:

Comments reader  4 Reader Comments

ron - Gravatar

latermuse.bandcamp.com ron said on August 23, 2012, 8:26 am:

Great! That fixed my ssh broken pipe error immediately. Wonderful.

Tom B. Taker - Gravatar

shoutsfromtheabyss.wordpress.com Tom B. Taker said on June 4, 2013, 6:03 pm:

Nice. I don’t know yet if this resolves my broken pipe irritation but I’m able to log in and out without having to enter the password each and every time. That’s nice! It freaked me out for a moment. Thanks! 🙂

Dianne - Gravatar

Dianne said on August 7, 2013, 10:21 pm:

Hi I tried to do this using vi:

vi ~/.ssh/config

then typed the commands as seen in the post.

When I tried to do

sh ~/.ssh/config

The terminal returned error:

/var/root/.ssh/config: line 1: ServerAliveInterval: command not found

and so on for all the lines.

What can I do to fix it? Would appreciate any help. Thank you very much!!

erics - Gravatar

www.wyzaerd.com erics said on August 7, 2013, 10:27 pm:

Why are you doing this command?

“sh ~/.ssh/config”

Running the config in the local Bourne shell (sh) is not needed. This is for ssh, the Secure Shell for remote connections.

What is the original problem you are trying to fix?

Leave Your Comment  Leave a comment

All fields marked with "*" are required.