Problem

Remote sessions of Visual Studio Code on CSCS systems are killed and disconnected automatically.

Solution

The default configuration of VScode is not secure when using SSH sessions. The solution for this to work is to configure the plugin as recommended by Microsoft on the plugin documentation.

In the Settings editor enable the following option Remote.SSH: Remote Server Listen On Socket :