最近更新VSCode后,发现SSH-Remote始终无法正常连接到远程主机,在网上搜索半天均未找到解决办法,最后尝试安装旧版本的VSCode,结果安装时提示“创建临时文件失败”。考虑到之前在使用matlab时,我不想让matlab的各种临时文件都保存到C盘便修改了用户环境变量中的TMP与TEMP,于是在我恢复了这两个环境变量后可以正常安装了。因为在SSH-REMOTE的输出日志中也有“访问被拒绝”的信息,我想会不会也是TMP路径问题导致的,所以我先放弃重装旧版本并再次用VSCode打开我之前的workspace,之前的问题也一并消失了。
下面是我的SSH-REMOTE故障信息:
> > Can you please provide more information, i.e. what version of VS Code and Remote-SSH you are using? What are your local and remote OS? Are you able to SSH into your remote machine on an external terminal? What steps did you take to receive this error, and how often do you receive it? >? > I have the same issue. There are my infos: >? > * VSCode Version: 1.59.0 (system setup) > * Local OS Version: Windows_NT x64 10.0.18362 > * Remote OS Version: CentOS-7.6 > * Remote Extension/Connection Type: SSH > * Logs: > ? [14:25:35.507] Log Level: 2 > ? [14:25:35.517] remote-ssh@0.65.7 > ? [14:25:35.517] win32 x64 > ? [14:25:35.518] SSH Resolver called for "ssh-remote+192.168.70.128", attempt 1 > ? [14:25:35.518] "remote.SSH.useLocalServer": false > ? [14:25:35.519] "remote.SSH.showLoginTerminal": false > ? [14:25:35.519] "remote.SSH.remotePlatform": {"192.168.70.128":"linux","192.168.6.123":"linux","10.100.10.102":"linux","192.168.2.199":"linux","10.100.10.104":"linux","10.100.10.103":"linux","10.168.100.91":"linux"} > ? [14:25:35.519] "remote.SSH.path": undefined > ? [14:25:35.519] "remote.SSH.configFile": undefined > ? [14:25:35.519] "remote.SSH.useFlock": true > ? [14:25:35.519] "remote.SSH.lockfilesInTmp": false > ? [14:25:35.520] "remote.SSH.localServerDownload": auto > ? [14:25:35.520] "remote.SSH.remoteServerListenOnSocket": false > ? [14:25:35.520] "remote.SSH.showLoginTerminal": false > ? [14:25:35.520] "remote.SSH.defaultExtensions": [] > ? [14:25:35.520] "remote.SSH.loglevel": 2 > ? [14:25:35.520] SSH Resolver called for host: 192.168.70.128 > ? [14:25:35.520] Setting up SSH remote "192.168.70.128" > ? [14:25:35.557] Using commit id "379476f0e13988d90fab105c5c19e7abc8b1dea8" and quality "stable" for server > ? [14:25:35.562] Install and start server if needed > ? [14:25:35.599] Checking ssh with "ssh -V" > ? [14:25:35.635] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 > ? [14:25:35.641] Running script with connection command: ssh -T -D 52644 "192.168.70.128" bash > ? [14:25:35.643] Terminal shell path: C:\Windows\System32\cmd.exe > ? [14:25:35.886] > ?�]0;C:\Windows\System32\cmd.exe� > ? [14:25:35.887] Got some output, clearing connection timeout > ? [14:25:35.894] > > ? [14:25:35.903] > 拒绝访问。 > ? [14:25:38.151] "install" terminal command done > ? [14:25:38.151] Install terminal quit with output: 拒绝访问。 > ? [14:25:38.151] Received install output: 拒绝访问。 > ? [14:25:38.152] Failed to parse remote port from server output > ? [14:25:38.152] Resolver error: Error: > ? at Function.Create (c:\Users\tangle.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:64659) > ? at Object.t.handleInstallOutput (c:\Users\tangle.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:63302) > ? at Object.t.tryInstall (c:\Users\tangle.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:415135) > ? at processTicksAndRejections (internal/process/task_queues.js:93:5) > ? at async c:\Users\tangle.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:294918 > ? at async Object.t.withShowDetailsEvent (c:\Users\tangle.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:406463) > ? at async Object.t.resolve (c:\Users\tangle.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:295994) > ? at async c:\Users\tangle.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:127:110656 > ? [14:25:38.159] ------ >? > It's OK to connect to my remote machine with ssh on termimal(cmd、xshell or powershell). And i also tried the command in logs ('ssh -T -D 52644 "192.168.70.128" bash') on powershell and it also works.
Well I have found a cause. I try to reinstall a previous VSCode but it pops out an error dialog with msg "couldn't create temp file" . Considering I modified my TMP and TEMP environment varialbes, I restore those variables and installation error is gone. I quit the installation and try my latest installed vscode again, and the issue alse is gone.
|