Thanks for sharing the details
Your SSH session in VS Code is disconnecting because the server closes idle connections. Please follow the steps below to fix the issue:
- Update the SSH server keep-alive settings:
Edit sshd_config and add:
ClientAliveInterval 60
ClientAliveCountMax 5
Then restart SSH and sudo systemctl restart sshd
- Enable VS Code keep-alive:
Add this in VS Code settings "remote.SSH.keepalive": 30
- Update your local SSH config:
ServerAliveInterval 60, ServerAliveCountMax , TCPKeepAlive yes
- Ensure stable network/VPN connection.
These settings prevent idle-timeout disconnections and keep your VS Code Remote-SSH session active.