How to Keep SSH Connections Alive on Mac

How to Keep SSH Connections Alive on Mac

Posted by · 2354 views · Translate
These are instructions on how to prevent timeout and keep SSH connections alive on Mac.

Step One
Launch Terminal from your Applications > Utilities folder.
How to Keep SSH Connections Alive on Mac

Step Two
Execute the following command into the Terminal window...

sudo nano ~/.ssh/config
How to Keep SSH Connections Alive on Mac

Enter your administrative user password when prompted.
How to Keep SSH Connections Alive on Mac

Step Three
Add the following line to your ssh config file.

ServerAliveInterval 100
How to Keep SSH Connections Alive on Mac

Step Four
Press Control+x to exit, then press Y when prompted to save changes.
How to Keep SSH Connections Alive on Mac

Step Six
Press Return to confirm the filename and exit.
How to Keep SSH Connections Alive on Mac

How to Keep SSH Connections Alive on Mac

New SSH connections should now stay open indefinitely. You can shorten or lengthen the interval as required by your server.
Recent