How do I keep SSH connection alive on Windows 10?

SlowerPhoton picture SlowerPhoton · Mar 26, 2018 · Viewed 12.4k times · Source

I've added the OpenSSH client (Beta) feature on Windows 10 so I can call it by running

ssh

on the command line.

However the terminal windows (and thus the connection) freezes when inactive for too long. I know I would solve this on Linux by editing the ~/.ssh/config file. Is there an equivalent on Windows?

Answer

傅继晗 picture 傅继晗 · Jul 2, 2020

in C:\Users\yourusername\.ssh make a newfile named config,and add lines below:

Host *
    ServerAliveInterval 40