当出现这个问题的时候,报错:
[15:44:00.161] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 50503 "121.199.33.139" bash
[15:44:00.164] Terminal shell path: C:\Windows\System32\cmd.exe
[15:44:00.416] > ]0;C:\Windows\System32\cmd.exe
[15:44:00.416] Got some output, clearing connection timeout
[15:44:00.446] > Bad owner or permissions on C:\\Users\\little scurry/.ssh/config
> 过程试图写入的管道不存在。
>
[15:44:01.699] "install" terminal command done
[15:44:01.699] Install terminal quit with output: 过程试图写入的管道不存在。
[15:44:01.700] Received install output: 过程试图写入的管道不存在。
[15:44:01.701] Failed to parse remote port from server output
[15:44:01.703] Resolver error: Error:
at g.Create (c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:499918)
at t.handleInstallOutput (c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:497240)
at t.tryInstall (c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:621085)
at async c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:580730
at async t.withShowDetailsEvent (c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:584036)
at async k (c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:577649)
at async t.resolve (c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:581407)
at async c:\Users\little scurry\.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:848023
主要是两个报错:
1.权限问题:Bad owner or permissions on C:\\Users\\little scurry/.ssh/config
2.管道错误:试图写入的管道不存在
第一个报错解决:
按 Win + X,选择“Windows PowerShell(管理员)”或“命令提示符(管理员)”。
icacls "C:\\Users\\little scurry\\.ssh\\config" #确定文件所有权
takeown /f "C:\\Users\\little scurry\\.ssh\\config"
icacls "C:\\Users\\little scurry\\.ssh\\config" /grant '%username%:F' #修改文件所有权
第二个报错解决:
确保系统中安装的 OpenSSH 工具路径正确配置,并且可以正确被 VS Code Remote-SSH 插件识别。在 VS Code 中,确认 SSH 配置路径是否正确配置。可以在 VS Code 设置中搜索 remote.SSH.configFile
,确保其值为 C:\Users\xxxxx\.ssh\config
或者手动设置为这个路径。
#### 我是按照我写的顺序解决的,但是我有一个猜想:不知道直接处理第二个报错能不能解决这个问题,读者可以试一下。