主题
远程 SSH 访问
Vibe Kanban 支持通过 SSH 远程访问服务器上的项目,让您可以在分布式环境中管理和执行编码任务。
功能概述
远程 SSH 访问功能允许您:
- 连接到远程服务器上的项目
- 使用本地 Vibe Kanban 界面管理远程任务
- 集成 VS Code Remote 进行代码编辑
- 在远程服务器上执行编码代理
配置 SSH 访问
通过设置界面配置
- 打开 Vibe Kanban 设置页面
- 导航到 Settings → Editor Integration
- 配置以下信息:
- Server Hostname:远程服务器地址
- SSH Port:SSH 端口(默认 22)
- Username:SSH 用户名
- Authentication:认证方式
认证方式
| 方式 | 说明 | 推荐场景 |
|---|---|---|
| SSH Key | 使用 SSH 密钥认证 | 生产环境(推荐) |
| Password | 使用密码认证 | 快速测试 |
| SSH Agent | 使用 SSH Agent 转发 | 多服务器环境 |
SSH Key 配置示例
bash
# 生成 SSH 密钥(如果没有)
ssh-keygen -t ed25519 -C "vibe-kanban"
# 将公钥复制到远程服务器
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@remote-server
# 测试连接
ssh user@remote-serverVS Code 集成
Vibe Kanban 可以与 VS Code Remote SSH 集成,提供无缝的远程开发体验。
配置步骤
- 安装 VS Code Remote - SSH 扩展
- 在 Vibe Kanban 设置中启用 VS Code 集成
- 配置远程服务器信息
VS Code SSH 配置
在 ~/.ssh/config 中添加:
Host vibe-kanban-remote
HostName your-server.example.com
User your-username
Port 22
IdentityFile ~/.ssh/id_ed25519
ForwardAgent yes远程项目管理
连接远程项目
- 在 Vibe Kanban 主界面点击 "Connect Remote"
- 选择已配置的服务器
- 浏览并选择项目目录
- 点击 "Connect" 建立连接
项目同步
Vibe Kanban 支持多种同步策略:
| 策略 | 说明 | 适用场景 |
|---|---|---|
| 实时同步 | 文件变更实时同步 | 小型项目 |
| 手动同步 | 手动触发同步 | 大型项目 |
| Git 同步 | 通过 Git 进行同步 | 团队协作 |
安全注意事项
网络安全
- 使用 SSH 密钥:避免使用密码认证
- 限制 IP 访问:配置防火墙规则限制 SSH 访问来源
- 使用非标准端口:考虑更改 SSH 默认端口
- 启用 Fail2ban:防止暴力破解攻击
凭证管理
- 不要硬编码密码:使用环境变量或密钥管理服务
- 定期轮换密钥:建议每 90 天轮换 SSH 密钥
- 使用 SSH Agent:避免在多处存储私钥
示例:安全配置
bash
# 禁用密码认证(在远程服务器上)
# /etc/ssh/sshd_config
PasswordAuthentication no
PubkeyAuthentication yes
PermitRootLogin no
# 重启 SSH 服务
sudo systemctl restart sshd故障排查
连接超时
bash
# 测试 SSH 连接
ssh -v user@remote-server
# 检查防火墙
sudo ufw status
# 检查 SSH 服务状态
sudo systemctl status sshd权限问题
bash
# 检查 SSH 密钥权限
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
chmod 700 ~/.ssh
# 检查远程目录权限
ssh user@remote-server "ls -la ~/.ssh"代理转发问题
bash
# 检查 SSH Agent
ssh-add -l
# 添加密钥到 Agent
ssh-add ~/.ssh/id_ed25519
# 测试 Agent 转发
ssh -A user@remote-server "ssh-add -l"