SSH Connexion impossible après inactivité

Bonjour à tous,

Après une inactivité, la connexion SSH à ma VM est rompue automatiquement.
Dès que je veux me reconnecter, j’ai beau relancé une fenêtre VS Code, ca ne fonctionne pas.

Voici le log en sortie :

[13:47:33.227] VS Code version: 1.85.1
[13:47:33.228] Remote-SSH version: remote-ssh@0.107.1
[13:47:33.228] win32 x64
[13:47:33.233] SSH Resolver called for "ssh-remote+63.33.55.236", attempt 1
[13:47:33.234] "remote.SSH.useLocalServer": false
[13:47:33.234] "remote.SSH.useExecServer": false
[13:47:33.235] "remote.SSH.showLoginTerminal": false
[13:47:33.235] "remote.SSH.remotePlatform": {"54.216.169.65":"linux","63.32.104.100":"linux","52.51.98.74":"linux","54.74.178.66":"linux","63.32.53.241":"linux","18.203.255.208":"linux","54.170.213.189":"linux","3.253.245.22":"linux","63.33.55.236":"linux"}
[13:47:33.236] "remote.SSH.path": undefined
[13:47:33.236] "remote.SSH.configFile": undefined
[13:47:33.236] "remote.SSH.useFlock": true
[13:47:33.237] "remote.SSH.lockfilesInTmp": false
[13:47:33.238] "remote.SSH.localServerDownload": auto
[13:47:33.238] "remote.SSH.remoteServerListenOnSocket": false
[13:47:33.239] "remote.SSH.showLoginTerminal": false
[13:47:33.239] "remote.SSH.defaultExtensions": []
[13:47:33.240] "remote.SSH.loglevel": 2
[13:47:33.240] "remote.SSH.enableDynamicForwarding": true
[13:47:33.241] "remote.SSH.enableRemoteCommand": false
[13:47:33.241] "remote.SSH.serverPickPortsFromRange": {}
[13:47:33.242] "remote.SSH.serverInstallPath": {}
[13:47:33.254] SSH Resolver called for host: 63.33.55.236
[13:47:33.254] Setting up SSH remote "63.33.55.236"
[13:47:33.264] Using commit id "0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2" and quality "stable" for server
[13:47:33.273] Install and start server if needed
[13:47:33.283] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[13:47:33.288] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[13:47:33.289] Checking ssh with "C:\Windows\ssh.exe -V"
[13:47:33.291] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[13:47:33.292] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[13:47:33.294] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[13:47:33.295] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[13:47:33.297] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[13:47:33.297] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[13:47:33.350] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[13:47:33.356] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 59607 "63.33.55.236" bash
[13:47:33.360] Terminal shell path: C:\Windows\System32\cmd.exe
[13:47:34.117] > e]0;C:\Windows\System32\cmd.exea
[13:47:34.118] Got some output, clearing connection timeout
[13:47:55.148] > ssh: connect to host 63.33.55.236 port 22: Connection timed out
[13:47:55.183] > Le processus a tenté d’écrire sur un canal inexistant.
[13:47:56.448] "install" terminal command done
[13:47:56.449] Install terminal quit with output: Le processus a tenté d’écrire sur un canal inexistant.
[13:47:56.450] Received install output: Le processus a tenté d’écrire sur un canal inexistant.
[13:47:56.453] Failed to parse remote port from server output
[13:47:56.458] Resolver error: Error: 
	at g.Create (c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:642703)
	at t.handleInstallOutput (c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:640069)
	at t.tryInstall (c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:761983)
	at async c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:722522
	at async t.withShowDetailsEvent (c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:725828)
	at async I (c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:719493)
	at async t.resolve (c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:723199)
	at async c:\Users\admin\.vscode\extensions\ms-vscode-remote.remote-ssh-0.107.1\out\extension.js:2:907003
[13:47:56.476] ------

Hello Axel,

Vérifie que l’IP de ta VM n’ait pas changé

Bien à toi,
Vincent

Bonjour Vincent,

Oui c’est bien la même IP.
A la première déconnexion, j’ai ce problème

A chaque déconnexion par inactivité, je peux plus me reconnecter et je dois réinitialiser la VM

J’ai désactivé Windows Defender (pare-feu) pour voir si c’était ça le problème et c’est le cas.

J’ai rajouté une règle de traffic entrant en autorisant la connexion sur le port 22. Normalement problème résolu :slight_smile:

Super, il est vrai que le pare feu peut couper la connexion

Meaculpa ca ne fonctionne pas après une déconnexion liée à l’inactivité je peux pas me reconnecter @Vincent-DataScientest

Je me suis trompé