Skip to content

远程 SSH 访问

Vibe Kanban 支持通过 SSH 远程访问服务器上的项目,让您可以在分布式环境中管理和执行编码任务。

功能概述

远程 SSH 访问功能允许您:

  • 连接到远程服务器上的项目
  • 使用本地 Vibe Kanban 界面管理远程任务
  • 集成 VS Code Remote 进行代码编辑
  • 在远程服务器上执行编码代理

配置 SSH 访问

通过设置界面配置

  1. 打开 Vibe Kanban 设置页面
  2. 导航到 Settings → Editor Integration
  3. 配置以下信息:
    • 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-server

VS Code 集成

Vibe Kanban 可以与 VS Code Remote SSH 集成,提供无缝的远程开发体验。

配置步骤

  1. 安装 VS Code Remote - SSH 扩展
  2. 在 Vibe Kanban 设置中启用 VS Code 集成
  3. 配置远程服务器信息

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

远程项目管理

连接远程项目

  1. 在 Vibe Kanban 主界面点击 "Connect Remote"
  2. 选择已配置的服务器
  3. 浏览并选择项目目录
  4. 点击 "Connect" 建立连接

项目同步

Vibe Kanban 支持多种同步策略:

策略说明适用场景
实时同步文件变更实时同步小型项目
手动同步手动触发同步大型项目
Git 同步通过 Git 进行同步团队协作

安全注意事项

网络安全

  1. 使用 SSH 密钥:避免使用密码认证
  2. 限制 IP 访问:配置防火墙规则限制 SSH 访问来源
  3. 使用非标准端口:考虑更改 SSH 默认端口
  4. 启用 Fail2ban:防止暴力破解攻击

凭证管理

  1. 不要硬编码密码:使用环境变量或密钥管理服务
  2. 定期轮换密钥:建议每 90 天轮换 SSH 密钥
  3. 使用 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"

下一步

aicodex 文档网站