feat: add quick command reference to guide, SSH support, and handoff doc
- Add copy-paste command reference card to guide.html Linux section - Add enable-ssh.sh standalone script for remote access on Live USB - Add optional SSH install prompt to setup-openclaw.sh - Add HANDOFF.md for Mac mini Claude Code remote takeover Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
58
HANDOFF.md
Normal file
58
HANDOFF.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Handoff Document — U-Claw Linux Remote Access
|
||||||
|
|
||||||
|
## Current Status
|
||||||
|
|
||||||
|
- U盘已就绪:Ventoy + Ubuntu 24.04 ISO + persistence + u-claw-linux scripts
|
||||||
|
- 所有源码已推送到 GitHub main 分支
|
||||||
|
- website/guide.html 已添加快速命令参考卡片
|
||||||
|
- enable-ssh.sh 已添加到 bootable/linux-setup/
|
||||||
|
|
||||||
|
## Linux 启动后需要做的事
|
||||||
|
|
||||||
|
1. 从 U 盘启动 → Ventoy 菜单选 Ubuntu
|
||||||
|
2. 如果首次使用,格式化持久化:
|
||||||
|
```
|
||||||
|
sudo bash /media/*/Ventoy/u-claw-linux/format-persistence.sh
|
||||||
|
```
|
||||||
|
然后重启
|
||||||
|
3. 连接 WiFi
|
||||||
|
4. 安装 OpenClaw:
|
||||||
|
```
|
||||||
|
sudo bash /media/*/Ventoy/u-claw-linux/setup-openclaw.sh
|
||||||
|
```
|
||||||
|
5. 启用 SSH(让 Mac mini 远程控制):
|
||||||
|
```
|
||||||
|
sudo bash /media/*/Ventoy/u-claw-linux/enable-ssh.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## SSH 连接信息
|
||||||
|
|
||||||
|
- **用户名**: ubuntu (Live USB 默认用户)
|
||||||
|
- **密码**: 运行 enable-ssh.sh 时设置
|
||||||
|
- **IP 地址**: 运行 enable-ssh.sh 后会显示,格式类似 192.168.x.x
|
||||||
|
- **前提**: 两台机器在同一个 WiFi/局域网下
|
||||||
|
|
||||||
|
## Mac mini Claude Code 接手方法
|
||||||
|
|
||||||
|
1. 用户在 Linux 上运行 `enable-ssh.sh`,获取 IP 和设置密码
|
||||||
|
2. 用户告诉 Mac mini 上的 Claude Code:IP 地址和密码
|
||||||
|
3. Mac mini Claude Code 通过 Bash 工具执行:
|
||||||
|
```
|
||||||
|
ssh ubuntu@<IP> 'command'
|
||||||
|
```
|
||||||
|
或建立持久连接进行调试
|
||||||
|
|
||||||
|
## 文件位置(Linux 上)
|
||||||
|
|
||||||
|
| 路径 | 说明 |
|
||||||
|
|------|------|
|
||||||
|
| `/media/*/Ventoy/u-claw-linux/` | U 盘上的脚本 |
|
||||||
|
| `/opt/u-claw/` | 安装后的 OpenClaw |
|
||||||
|
| `/opt/u-claw/start-openclaw.sh` | 启动脚本 |
|
||||||
|
| `/opt/u-claw/data/.openclaw/openclaw.json` | 配置文件 |
|
||||||
|
|
||||||
|
## 注意事项
|
||||||
|
|
||||||
|
- Live USB 每次重启后,除了持久化分区内的数据,其他都会重置
|
||||||
|
- SSH server 需要每次重启后重新安装(除非持久化生效)
|
||||||
|
- 持久化生效后,apt 安装的包会保留
|
||||||
31
bootable/linux-setup/enable-ssh.sh
Normal file
31
bootable/linux-setup/enable-ssh.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# ============================================================
|
||||||
|
# Enable SSH server on Ubuntu Live USB
|
||||||
|
# Usage: sudo bash enable-ssh.sh
|
||||||
|
# ============================================================
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
echo "Usage: sudo bash enable-ssh.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installing OpenSSH server..."
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install -y -qq openssh-server
|
||||||
|
|
||||||
|
systemctl enable ssh
|
||||||
|
systemctl start ssh
|
||||||
|
|
||||||
|
REAL_USER="${SUDO_USER:-$USER}"
|
||||||
|
echo ""
|
||||||
|
echo "Set a password for SSH login (user: $REAL_USER):"
|
||||||
|
passwd "$REAL_USER"
|
||||||
|
|
||||||
|
LOCAL_IP=$(ip -4 addr show | grep -oP '(?<=inet\s)(?!127\.)\d+\.\d+\.\d+\.\d+' | head -1)
|
||||||
|
echo ""
|
||||||
|
echo "========================================"
|
||||||
|
echo " SSH Ready!"
|
||||||
|
echo " From Mac mini or other computer:"
|
||||||
|
echo " ssh ${REAL_USER}@${LOCAL_IP}"
|
||||||
|
echo "========================================"
|
||||||
@@ -185,6 +185,23 @@ if [[ "$AUTOSTART" =~ ^[Yy]$ ]]; then
|
|||||||
echo " Autostart enabled."
|
echo " Autostart enabled."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ── Optional: Install SSH for remote management ──
|
||||||
|
echo ""
|
||||||
|
read -rp "Install SSH server for remote access? (y/N): " INSTALL_SSH
|
||||||
|
if [[ "$INSTALL_SSH" =~ ^[Yy]$ ]]; then
|
||||||
|
echo " Installing OpenSSH server..."
|
||||||
|
apt-get install -y -qq openssh-server > /dev/null 2>&1
|
||||||
|
systemctl enable ssh
|
||||||
|
systemctl start ssh
|
||||||
|
echo ""
|
||||||
|
echo " Set a password for SSH login (user: $REAL_USER):"
|
||||||
|
passwd "$REAL_USER"
|
||||||
|
LOCAL_IP=$(ip -4 addr show | grep -oP '(?<=inet\s)(?!127\.)\d+\.\d+\.\d+\.\d+' | head -1)
|
||||||
|
echo ""
|
||||||
|
echo " SSH enabled! Connect from another computer:"
|
||||||
|
echo " ssh ${REAL_USER}@${LOCAL_IP}"
|
||||||
|
fi
|
||||||
|
|
||||||
# ── Set ownership ──
|
# ── Set ownership ──
|
||||||
chown -R "$REAL_USER:$REAL_USER" "$INSTALL_DIR/data"
|
chown -R "$REAL_USER:$REAL_USER" "$INSTALL_DIR/data"
|
||||||
|
|
||||||
|
|||||||
@@ -1145,6 +1145,23 @@ openclaw plugin uninstall <插件名></code></pre>
|
|||||||
|
|
||||||
<div class="warn"><strong>Secure Boot 问题:</strong>如果无法从 USB 启动,进入 BIOS 设置关闭 Secure Boot。路径通常是 Security → Secure Boot → Disabled。</div>
|
<div class="warn"><strong>Secure Boot 问题:</strong>如果无法从 USB 启动,进入 BIOS 设置关闭 Secure Boot。路径通常是 Security → Secure Boot → Disabled。</div>
|
||||||
|
|
||||||
|
<div class="card" style="background:#1a1a2e;border:2px solid #0f3460;margin-bottom:2rem;">
|
||||||
|
<h3 style="margin-top:0;">快速命令参考(复制粘贴用)</h3>
|
||||||
|
<p style="color:var(--dim)">在 Ubuntu 终端中:Ctrl+Shift+V 粘贴</p>
|
||||||
|
|
||||||
|
<strong>第一步:格式化持久化(仅首次,格式化后必须重启)</strong>
|
||||||
|
<pre><code>sudo bash /media/*/Ventoy/u-claw-linux/format-persistence.sh</code></pre>
|
||||||
|
|
||||||
|
<strong>第二步:重启后,安装 OpenClaw</strong>
|
||||||
|
<pre><code>sudo bash /media/*/Ventoy/u-claw-linux/setup-openclaw.sh</code></pre>
|
||||||
|
|
||||||
|
<strong>第三步:启动 AI 助手</strong>
|
||||||
|
<pre><code>bash /opt/u-claw/start-openclaw.sh</code></pre>
|
||||||
|
|
||||||
|
<strong>启用 SSH(可选,让其他电脑远程控制)</strong>
|
||||||
|
<pre><code>sudo bash /media/*/Ventoy/u-claw-linux/enable-ssh.sh</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>首次启动 Ubuntu</h2>
|
<h2>首次启动 Ubuntu</h2>
|
||||||
|
|
||||||
<div class="step"><div class="step-num">1</div><div class="step-content"><strong>Ventoy 菜单选择 Ubuntu</strong>
|
<div class="step"><div class="step-num">1</div><div class="step-content"><strong>Ventoy 菜单选择 Ubuntu</strong>
|
||||||
|
|||||||
Reference in New Issue
Block a user