SSH config for OS X users to keep connections from dropping on MiFi and other mobile hotspots

If you use SSH and are often using your cellphone as a mobile hotspot, or use a MiFi as a hotspot, you probably noticed that if you don’t do anything in your SSH window for a while, the connection drops, usually with a ‘Broken Pipe’ message.

Suffer no more…

Create an ‘.ssh’ directory off your home directory in terminal.

Add a .ssh/config file.

Add the following lines:

TCPKeepAlive no
ServerAliveInterval 1
ServerAliveCountMax 99999999

Then go to lunch, come back and your SSH connection will still be alive and kicking without you having to reconnect. Enjoy.

One thought on “SSH config for OS X users to keep connections from dropping on MiFi and other mobile hotspots

Comments are closed.