April 23, 2024
How to Keep SSH Connections Alive on Mac

How to Keep SSH Connections Alive on Mac

Posted December 9, 2021 at 5:45am by iClarified
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.
Add Comment
Would you like to be notified when someone replies or adds a new comment?
Yes (All Threads)
Yes (This Thread Only)
No
iClarified Icon
Notifications
Would you like to be notified when we post a new Apple news article or tutorial?
Yes
No
Comments
You must login or register to add a comment...
Recent. Read the latest Apple News.
RECENT
Tutorials. Help is here.
TUTORIALS
Where to Download macOS Monterey
Where to Download macOS Ventura
AppleTV Firmware Download Locations
Where To Download iPad Firmware Files From
Where To Download iPhone Firmware Files From
Deals. Save on Apple devices and accessories.
DEALS