【发布时间】:2026-01-06 21:05:01
【问题描述】:
我已经在 VS Code 中安装并使用了 Remote-SSH 扩展来访问 Linux 暂存环境并远程工作。
设置和连接适用于一个用户,但不允许我以不同用户的身份连接(在同一台服务器上)。
连接后立即弹出错误提示the terminal process failed to launch: A native exception occurred during launch (forkpty(3) failed.).,终端将无法打开。如果我尝试手动打开终端,它将失败并出现同样的错误。
这是我的 Remote-SSH 配置文件的外观示例:
Host configfile1
HostName host.website.com
User username1
IdentifyFile "[key file path]"
Host configfile2
HostName host.website.com
User username2
IdentifyFile "[key file path]"
我可以正常连接并使用configfile1 打开远程终端,但是在尝试使用configfile2 连接时会遇到上述错误。
我尝试了这个 GitHub 问题线程中提到的各种解决方案,但无济于事:https://github.com/microsoft/vscode-remote-release/issues/4233
有人对此有解决方案吗?
【问题讨论】:
标签: shell visual-studio-code ssh terminal vscode-remote