问题描述:
VScode重启更新后,SSH远程连接失败,反复尝试都不起作用。具体现象如下(因为解决以后log记录就没了,所以借了下别人的log):
[08:48:13.513] Server installation process already in progress - waiting and retrying [08:48:14.517] Running script with connection command: ssh -T -D 58042 "192.168.31.235" bash [08:48:14.518] Terminal shell path: C:\Windows\System32\cmd.exe [08:48:14.900] > ]0;C:\Windows\System32\cmd.exe [08:48:14.900] Got some output, clearing connection timeout [08:48:14.933] "install" terminal command done [08:48:14.933] Install terminal quit with output: [08:48:15.404] > 741b6048ee5c: running [08:48:15.469] > Acquiring lock on /home/zhangyasheng/.vscode-server/bin/c3f126316369cd610563c75b > 1b1725e0679adfb3/vscode-remote-lock.zhangyasheng.c3f126316369cd610563c75b1b1725e > 0679adfb3 [08:48:15.478] > Installation already in progress... > If you continue to see this message, you can try toggling the remote.SSH.useFloc > k setting > 741b6048ee5c: start > exitCode==24== > listeningOn==== > osReleaseId==ubuntu== > arch==x86_64== > tmpDir==/run/user/1017== > platform==linux== > unpackResult==== > didLocalDownload==0== > downloadTime==== > installTime==== > extInstallTime==== > serverStartTime==== > 741b6048ee5c: end [08:48:15.478] Received install output: exitCode==24== listeningOn==== osReleaseId==ubuntu== arch==x86_64== tmpDir==/run/user/1017== platform==linux== unpackResult==== didLocalDownload==0== downloadTime==== installTime==== extInstallTime==== serverStartTime====
原因分析:
通过其他工具可以正常的与服务器建立SSH连接,所以问题的所在与SSH服务本身无关。
根据vscode ssh连接失败_myWorld001的博客-CSDN博客这篇文章的说明分析,SSH连接不上是因为VScode更新后,~/.vscode-server/bin中的文件过期了导致的。
解决方案:
将~/.vscode-server/bin/xxxxxxxxxxxxxxx文件删除(具体删除哪个文件要看log中用的是哪个文件),然后重新进行SSH连接即可。
更多精彩内容,请关注公众号