How to prevent SSH from timing out on linux

You can do it on client side or server side.

Client side

Edit /etc/ssh/ssh_config, and add the following line to the end of the file:

ClientAliveInterval 60

Server side

Edit /etc/ssh/sshd_config,and add the following line to the end of the file:

ServerAliveInterval 60

after edit the file, restart sshd service:

systemctl restart ssh

This article is originally created by tooli.top. Please indicate the source when reprinting : https://www.tooli.top/posts/ssh_alive

Posted on 2022-03-25 Mail to author