You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code连接Docker Dev Container失败:Shell服务终止及权限拒绝问题

VS Code连接远程Docker容器失败:Shell server终止+权限拒绝

此前可正常通过VS Code连接Docker容器,时隔数周再次连接同一容器时出现错误:

Error running command remote-containers.attachToRunningContainerFromViewlet: Shell server terminated (code: 255, signal: null)

已尝试更换、重新安装Dev Containers扩展,均无效。日志末尾提示Permission denied (publickey,password),但未找到解决方法,寻求帮助。

终端日志

[78 ms] Dev Containers 0.266.1 in VS Code 1.71.2 (74b1f979648cc44d385a2286793c226e611f59e7).
[78 ms] Start: Resolving Remote
[79 ms] Setting up container: /ycool.kwon_test
[79 ms] Host: ssh://10.229.9.224
[83 ms] Start: Run: ssh 10.229.9.224 /bin/sh
[156 ms] Start: Run in host: id -un
[10633 ms] Shell server terminated (code: 255, signal: null)

XSL 파일 경로나 파일 이름이 잘못되었습니다.
node:child_process:925
    throw err;
    ^

Error: Command failed: wmic process where (commandline like "%ssh-askpass.bat%") get processid,parentprocessid /format:"%WINDIR%\System32\wbem\en-us\csv"
XSL 파일 경로나 파일 이름이 잘못되었습니다.

    at checkExecSyncError (node:child_process:848:11)
    at Object.execSync (node:child_process:922:15)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:5:12704)
    at Object.<anonymous> (c:\Users\ycool.kwon.SECDS\.vscode\extensions\ms-vscode-remote.remote-containers-0.266.1\dist\common\sshAskpass.js:5:808)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
    at Module.load (node:internal/modules/cjs/loader:1035:32)
    at Module._load (node:internal/modules/cjs/loader:876:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  status: 44210,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(44) [Uint8Array] [
       88,  83,  76,  32, 199, 252, 189, 196,  32,
      182, 199, 180, 194,  32, 198, 196, 192, 207,
       32, 192, 204, 184, 167, 192, 204,  32, 192,
      223, 184, 248, 181, 199, 190, 250, 189, 192,
      180, 207, 180, 217,  46,  13,  13,  10
    ]
  ],
  pid: 30544,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(44) [Uint8Array] [
     88,  83,  76,  32, 199, 252, 189, 196,  32,
    182, 199, 180, 194,  32, 198, 196, 192, 207,
     32, 192, 204, 184, 167, 192, 204,  32, 192,
    223, 184, 248, 181, 199, 190, 250, 189, 192,
    180, 207, 180, 217,  46,  13,  13,  10
  ]
}
Permission denied, please try again.
XSL 파일 경로나 파일 이름이 잘못되었습니다.
node:child_process:925
    throw err;
    ^

Error: Command failed: wmic process where (commandline like "%ssh-askpass.bat%") get processid,parentprocessid /format:"%WINDIR%\System32\wbem\en-us\csv"
XSL 파일 경로나 파일 이름이 잘못되었습니다.

    at checkExecSyncError (node:child_process:848:11)
    at Object.execSync (node:child_process:922:15)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:5:12704)
    at Object.<anonymous> (c:\Users\ycool.kwon.SECDS\.vscode\extensions\ms-vscode-remote.remote-containers-0.266.1\dist\common\sshAskpass.js:5:808)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
    at Module.load (node:internal/modules/cjs/loader:1035:32)
    at Module._load (node:internal/modules/cjs/loader:876:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  status: 44210,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(44) [Uint8Array] [
       88,  83,  76,  32, 199, 252, 189, 196,  32,
      182, 199, 180, 194,  32, 198, 196, 192, 207,
       32, 192, 204, 184, 167, 192, 204,  32, 192,
      223, 184, 248, 181, 199, 190, 250, 189, 192,
      180, 207, 180, 217,  46,  13,  13,  10
    ]
  ],
  pid: 17512,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(44) [Uint8Array] [
     88,  83,  76,  32, 199, 252, 189, 196,  32,
    182, 199, 180, 194,  32, 198, 196, 192, 207,
     32, 192, 204, 184, 167, 192, 204,  32, 192,
    223, 184, 248, 181, 199, 190, 250, 189, 192,
    180, 207, 180, 217,  46,  13,  13,  10
  ]
}
Permission denied, please try again.
XSL 파일 경로나 파일 이름이 잘못되었습니다.
node:child_process:925
    throw err;
    ^

Error: Command failed: wmic process where (commandline like "%ssh-askpass.bat%") get processid,parentprocessid /format:"%WINDIR%\System32\wbem\en-us\csv"
XSL 파일 경로나 파일 이름이 잘못되었습니다.

    at checkExecSyncError (node:child_process:848:11)
    at Object.execSync (node:child_process:922:15)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:5:12704)
    at Object.<anonymous> (c:\Users\ycool.kwon.SECDS\.vscode\extensions\ms-vscode-remote.remote-containers-0.266.1\dist\common\sshAskpass.js:5:808)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
    at Module.load (node:internal/modules/cjs/loader:1035:32)
    at Module._load (node:internal/modules/cjs/loader:876:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  status: 44210,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(44) [Uint8Array] [
       88,  83,  76,  32, 199, 252, 189, 196,  32,
      182, 199, 180, 194,  32, 198, 196, 192, 207,
       32, 192, 204, 184, 167, 192, 204,  32, 192,
      223, 184, 248, 181, 199, 190, 250, 189, 192,
      180, 207, 180, 217,  46,  13,  13,  10
    ]
  ],
  pid: 51760,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(44) [Uint8Array] [
     88,  83,  76,  32, 199, 252, 189, 196,  32,
    182, 199, 180, 194,  32, 198, 196, 192, 207,
     32, 192, 204, 184, 167, 192, 204,  32, 192,
    223, 184, 248, 181, 199, 190, 250, 189, 192,
    180, 207, 180, 217,  46,  13,  13,  10
  ]
}
ycool.kwon@10.229.9.224: Permission denied (publickey,password).

解决建议

1. 修复SSH密码弹窗工具的XSL错误

日志中反复出现的韩文提示意为“XSL文件路径或名称错误”,这是因为VS Code的SSH密码弹窗工具调用wmic时指定的英文XSL格式文件不存在(系统为韩文环境)。

  • 打开管理员权限的命令提示符,执行以下命令复制韩文XSL文件到英文目录:
    mkdir "%WINDIR%\System32\wbem\en-us"
    copy "%WINDIR%\System32\wbem\ko-kr\csv.xsl" "%WINDIR%\System32\wbem\en-us\"
    
  • 或直接改用SSH密钥认证,避免密码弹窗工具的调用。

2. 验证SSH基础连接

  • 在本地终端手动执行ssh ycool.kwon@10.229.9.224,确认能否正常登录:
    • 若手动登录失败,检查服务器sshd_config是否开启密码登录(PasswordAuthentication yes),或本地公钥是否已添加到服务器~/.ssh/authorized_keys中。
    • 执行ssh-add -l查看本地已加载的SSH密钥,确认密钥是否正确配置。

3. 重置VS Code远程连接缓存

  • 删除VS Code远程容器缓存目录:%APPDATA%\Code\User\globalStorage\ms-vscode-remote.remote-containers,移除对应容器的配置文件夹。
  • 重新添加远程容器连接,手动输入服务器地址与认证信息。

4. 检查Docker容器状态

  • 登录远程服务器后,执行docker ps确认/ycool.kwon_test容器是否正常运行,若已停止则重启容器后再尝试连接。

内容的提问来源于stack exchange,提问作者eve

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 20:20:39