> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trae.cn/llms.txt?lang=zh
> Use this file to discover all available pages before exploring further.

远程资源管理功能（Remote SSH）提供了在本地 PC 上直接访问和操作远程主机文件的能力。通过这一功能，你无需在本地 PC 上存储远程主机上的源代码，即可充分利用 TraeCode 的全部功能（包括代码补全、导航、调试、AI 辅助等）来管理远程主机上的文件。

具体而言，当你通过 TraeCode 连接本地 PC 与远程主机时，系统会自动在远程主机的操作系统上安装 TraeCode 服务端。TraeCode 服务端与远程主机上已存在的 TraeCode 客户端相互独立，包含了所有必要的后台服务，确保提供与本地开发环境一致的使用体验。

<div class="flow-chart-container"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="-0.5 -0.5 715 265"><defs/><g><rect x="2" y="2" width="220" height="260" rx="33" ry="33" fill="#ffffff" stroke="#000000" pointer-events="all"/><rect x="84.5" y="12" width="55" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 53px; height: 1px; padding-top: 22px; margin-left: 86px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><font style="font-size:14px"><b>本地 PC</b></font></div></div></div></foreignObject></g><rect x="32" y="52" width="160" height="180" rx="24" ry="24" fill="#d4e1f5" stroke="#000000" pointer-events="all"/><rect x="65.13" y="62" width="93.75" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 92px; height: 1px; padding-top: 72px; margin-left: 66px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">TRAE 客户端</div></div></div></foreignObject></g><rect x="62" y="112" width="100" height="30" rx="4.5" ry="4.5" fill="#e1d5e7" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 98px; height: 1px; padding-top: 127px; margin-left: 63px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">UI 插件</div></div></div></foreignObject></g><rect x="62" y="172" width="100" height="30" rx="4.5" ry="4.5" fill="#e1d5e7" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 98px; height: 1px; padding-top: 187px; margin-left: 63px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">UI 插件</div></div></div></foreignObject></g><rect x="342" y="2" width="370" height="260" rx="39" ry="39" fill="#ffffff" stroke="#000000" pointer-events="all"/><rect x="515.75" y="12" width="62.5" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 61px; height: 1px; padding-top: 22px; margin-left: 517px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><span style="font-size:14px"><b>远程主机</b></span></div></div></div></foreignObject></g><rect x="372" y="52" width="160" height="180" rx="24" ry="24" fill="#d4e1f5" stroke="#000000" pointer-events="all"/><rect x="405.13" y="62" width="93.75" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 92px; height: 1px; padding-top: 72px; margin-left: 406px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">TRAE 服务端</div></div></div></foreignObject></g><rect x="402" y="112" width="100" height="30" rx="4.5" ry="4.5" fill="#e1d5e7" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 98px; height: 1px; padding-top: 127px; margin-left: 403px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">工作区插件</div></div></div></foreignObject></g><rect x="402" y="172" width="100" height="30" rx="4.5" ry="4.5" fill="#e1d5e7" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 98px; height: 1px; padding-top: 187px; margin-left: 403px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">AI 后端</div></div></div></foreignObject></g><rect x="602" y="72" width="90" height="30" rx="4.5" ry="4.5" fill="#d5e8d4" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 87px; margin-left: 603px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">代码</div></div></div></foreignObject></g><rect x="602" y="132" width="90" height="30" rx="4.5" ry="4.5" fill="#d5e8d4" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 147px; margin-left: 603px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">终端</div></div></div></foreignObject></g><rect x="602" y="192" width="90" height="30" rx="4.5" ry="4.5" fill="#d5e8d4" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 207px; margin-left: 603px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">调试器</div></div></div></foreignObject></g><path d="M 222 142 L 334.89 141.89" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 340.14 141.88 L 333.15 145.39 L 334.89 141.89 L 333.14 138.39 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="262" y="117" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 127px; margin-left: 282px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">SSH 通道</div></div></div></foreignObject></g><path d="M 532.16 87.28 L 595.63 87.03" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 600.88 87 L 593.9 90.53 L 595.63 87.03 L 593.87 83.53 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 532 146.72 L 595.47 146.47" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 600.72 146.44 L 593.74 149.97 L 595.47 146.47 L 593.71 142.97 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 532.16 206.72 L 595.63 206.47" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 600.88 206.44 L 593.9 209.97 L 595.63 206.47 L 593.87 202.97 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/></g></svg></div>

## 前置条件 {#8f54227e}

* 确保你的开发环境满足以下要求：
   <!-- @cols-width: 100,783 -->
   | **设备类型**  | **要求**  |
   | --- | --- |
   | 本地 PC  | 确保安装了 OpenSSH 兼容的 SSH 客户端，操作系统可为 macOS 或 Windows。  |
   | 远程主机  | 目前，仅支持 Linux 操作系统，建议的系统版本和配置如下： | \
   | | | \
   | | * 操作系统： | \
   | |    * Debian 格式：Debian 10+、Ubuntu 20.04+ | \
   | |    * RPM 格式：Fedora 42、RHEL 9.x | \
   | | * 系统配置：至少 1 GB RAM，更推荐 2 GB 和 2-core CPU 的组合 | \
   | | * 处理器：x64、ARM64 | \
   | | | \
   | | ***提示***：低于要求的操作系统版本（如 Debian 8、Ubuntu 16 等）将导致你无法使用 AI 功能，包括 Inline Chat、Side Chat、代码自动补全、AI 生成 Git Commit 消息等，同时也可能与其它功能存在兼容性问题。  |
* 确保远程服务器已安装并运行 SSH 服务器。
* 为了确保 TRAE 服务端的正常运行，远程主机需要具备出站 HTTPS 访问能力（通过端口 443）。这一连接主要用于 TRAE 服务端与外部端点的通信，用于更新服务和拓展支持。
* 某些扩展可能有额外的连接性要求。

## 连接远程主机 {#76a28db2}

在本地 PC 上连接远程主机后，你可以在本地 PC 上为远程主机上的文件开发内容。

1. 打开远程资源管理器，然后点击 **+** 按钮。
   ![Image=2880x1799](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/283434df7d844104bf9cb565f9d01024~tplv-goo7wpa0wc-topic.webp)
   界面上显示 **输入 SSH 连接命令** 面板。
   ![Image=2880x1799](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/22479e3f65474cba8aecd16b71fa8356~tplv-goo7wpa0wc-topic.webp)
2. 输入 SSH 连接命令，然后按下回车键。
   远程主机已添加，界面右下方出现提示框，**SSH 连接目标** 列表中出现远程主机地址。
   ![Image=2880x1799](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/09be1f58340f45af93ac78699512d071~tplv-goo7wpa0wc-topic.webp)
3. 在右下方的提示框中，点击 **连接主机** 按钮；或在 **SSH 连接目标** 列表中，将鼠标悬浮至目标主机地址，然后点击右侧的 **在新窗口连接主机** 图标。
   界面上显示密码输入框。
   ![Image=2880x1799](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/2dc32f5ff48a4dfeb3d0e45080fae0c6~tplv-goo7wpa0wc-topic.webp)
4. 输入密码，然后按下回车键。
   :::tip 提示
   * 建议使用基于密钥的认证以提高安全性。
   * 密码不会被保存，每次连接时都需要重新输入。
   :::
   TraeCode 开始连接远程主机。连接成功后，界面左下角显示已连接的主机地址。
   ![Image=2880x1799](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/8738ad83a1b840bb97e3b2a80f3cf109~tplv-goo7wpa0wc-topic.webp)
5. 打开远程主机中的文件夹，开始远程开发。

## 断开与远程主机的连接 {#b54a4659}


* 直接退出 TraeCode，下次打开后会优先提示你完成远程连接。
* 在顶部菜单栏中，选择 **文件** > **关闭远程连接**。
   ![Image=2880x1800](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/b952a177c7374575b742d2a427616da6~tplv-goo7wpa0wc-topic.webp)   


## 配置或删除连接主机 {#bfb9cdba}

点击远程资源管理器中的 **修改远程连接配置** 图标，然后在 config 文件中配置或删除远程主机。

![Image=2880x1800](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/a14e38d393254699a2fe15f66d89484b~tplv-goo7wpa0wc-topic.webp)

## 快捷操作面板说明 {#ca9f3318}

使用 Alt + Ctrl + O 快捷键可打开 Remote SSH 快捷操作面板。你可以在面板上直接发起连接主机、打开远程连接配置文件等操作。

![Image=550x238](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/a3e5ffda8e4f46818f8858ce657cc70f~tplv-goo7wpa0wc-topic.webp)

## 更多功能 {#b1d6b70e}

### 管理插件 {#bad8e1f2}

插件可分别在本地 PC 和远程主机中运行：

* **本地运行插件**：提供用户界面相关的插件通常在本地运行。
* **远程主机插件**：语言支持、调试工具等插件则在远程主机运行。

在插件市场的 **已安装** 列表中，你可以查看本地 PC 和远程主机中安装的插件，然后按需管理它们。

![Image=350x320](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/83e38fe836a64ddf88794315d5a02f74~tplv-goo7wpa0wc-topic.webp)

### 打开远程主机的终端 {#90997ee1}

在顶部菜单栏中，选择 **终端** > **新建终端**，打开在远程主机上运行的终端，然后执行命令。

![Image=1371x858](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/d1068c1be7ea4361884cf26f512c4887~tplv-goo7wpa0wc-topic.webp)

### **转发远程端口至本地 PC** {#15e83845}

TraeCode 支持将远程主机的端口转发到本地 PC，你可以在终端中配置。

![Image=1368x856](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/98510fc954f0454d8b4d99bccfce10b1~tplv-goo7wpa0wc-topic.webp)

### 远程调试 {#10636da5}

连接到远程主机后，可以使用 TraeCode 的调试功能，与本地调试类似。在 launch.json 文件中选择启动配置并按 F5 键开始调试，应用程序将在远程主机上启动，调试器会附加到其中。
