1. Login to the server using SSH
ssh <username>@<ip_address> -p <port>
2. Run command nano /etc/ssh/sshd_config in the panel
sudo nano /etc/ssh/sshd_config
Note: nano or vim editor can be used for this
3. This will open a file like below
4. Then find the command ClientAliveInterval and add your desired timeout in seconds after uncommenting the command.
ClientAliveInterval 300
5. Save the file and restart the sshd using below command
Systemctl restart sshd