To prevent your SSH session from timing out, you can configure the SSH server settings to keep the session alive. Here's how:
Edit the SSH server configuration file:
Add or modify the following lines to keep the SSH connection alive:
ClientAliveInterval 60
: This sets the server to send a message to the client every 60 seconds to keep the connection alive.ClientAliveCountMax 3
: This specifies that if the server doesn't receive a response from the client after 3 consecutive keep-alive messages, the server will disconnect the session.
Restart the SSH service to apply the changes: