Files
u-claw/bootable/linux-setup/enable-ssh.sh
hfshfg c7ac2e6a7a 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>
2026-03-16 21:01:23 +08:00

32 lines
870 B
Bash

#!/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 "========================================"