Post

Keep SSH active

Prevent SSH connections from timing out by configuring a keep-alive interval in your SSH config file.

Make this part of your SSH config file.

Add the following to your ~/.ssh/config to send keep-alive packets every 60 seconds, preventing idle SSH sessions from being dropped by firewalls or NAT devices. The AddressFamily inet directive forces IPv4 connections.

1
2
3
4
5
worker ~ $ cat ~/.ssh/config
Host *
    ServerAliveInterval 60
    AddressFamily inet

This post is licensed under CC BY 4.0 by the author.