Need to add the following lines to ssh config (~/.ssh/config or /etc/ssh/ssh_config depending on your desired scope)
ServerAliveInterval 300
ServerAliveCountMax 3

Copyright Xiaoquan (Michael) Zhang, 2004-2020. All rights reserved.
All trademarks property of their owners.