How to prevent ssh client from timing out

March 29, 2021

SSH drops idle connections after 30 seconds or something with the error client_loop: send disconnect: Broken pipe. Here's how to fix that...

Create a file ~/.ssh/config and add the following

# Prevent connection drop
ServerAliveInterval 180

Save and reconnect. Now it will stay connected until you tell it to close.

Have a great day!