For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /general/ssh_security/how_to_prevent_frequent_ssh_and_scp_disconnects.md.

How to Prevent Frequent SSH and SCP Disconnects

SSH and SCP connections can drop when there is no data transfer for a while. Sending keepalive packets helps maintain the connection and can prevent disconnects caused by connection timeouts. This guide shows how to turn them on in WinSCP and PuTTY.

WinSCP

Open WinSCP

Open WinSCP.

Click Advanced

Click the Advanced button.

Advanced button in WinSCP

Open the Connection settings

Click Connection. The connection settings window opens.

Connection settings in WinSCP

Set the keepalive options

Change Server response timeout to 15, select Sending of null SSH packets, and change Seconds between keepalives to 10. Then click OK.

Keepalive settings in WinSCP

Log in

Click the Login button to connect.

WinSCP login window

PuTTY

Open PuTTY

Open PuTTY.

Open the Connection category

Click Connection under Category.

Connection category in PuTTY

Set the keepalive interval

Change Seconds between keepalives to 10.

Seconds between keepalives in PuTTY

Connect

Click Session under Category and enter the IP address. Then click the Open button.

Session settings in PuTTY