Files
nexus/wiki/concepts/Remote-SSH.md
2026-04-22 12:02:55 +08:00

36 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Remote-SSH"
type: concept
tags: [remote-development, ssh, ide]
last_updated: 2026-04-22
---
## Definition
通过 SSH 协议将本地 IDE 连接到远程服务器的开发模式。代码实际运行在远程服务器上,但编辑器和 UI 交互发生在本地机器。
## Mechanism
1. 本地 IDE 安装 Remote-SSH 插件
2. 通过 SSH Config 定义远程服务器连接信息
3. 连接时在远程服务器自动安装轻量级代理VS Code Server / Trae Server
4. 所有文件编辑、终端、Git 操作均通过 SSH 隧道与远程服务器通信
## Key Features
- 代码不离开服务器,数据安全
- 利用服务器算力GPU、大内存进行开发
- 支持 Docker 容器 Attach 开发模式
- 支持多终端窗口
- SSH Agent Forwarding 可复用本地 SSH Key 访问 Git
## Two Docker Development Modes
- **Attach 容器模式**:直接进入已在运行的 Docker 容器内部编辑代码,适合调试,环境完全隔离
- **宿主机文件 + Docker CLI 模式**:编辑 Ubuntu 宿主机上的源码目录,在终端调用 docker compose适合编排多容器配置
## Connections
- [[Trae]] — IDE 实现
- [[Cursor]] — 支持 Remote-SSH
- [[SSH Config]] — 连接配置方式
- [[SSH 免密登录]] — 前提条件
- [[Attach 容器]] — 容器开发模式
- [[Bind Mount]] — 开发环境代码挂载机制
- [[Docker]] — 容器化开发环境