公益 · 免费 · 永久免费

SamCommand

把任何机器变成可远程控制的命令执行代理。一行命令安装,公网 URL 直连,跨平台支持 Linux / macOS / Windows / Android。

为什么选择 SamCommand

基于 aitun.cc 隧道,无需公网 IP,无需开端口。启动即获得公网 HTTPS URL,任何设备都能远程控制。

🌐
公网 URL 直连
基于 aitun.cc 隧道,启动即获得 https://<sub>.t.aitun.cc 公网地址,任何设备都能访问。
远程 Shell 执行
POST /exec 即可执行任意 shell 命令(bash/cmd),支持 cwd、timeout、env 自定义。
📁
文件双向传输
POST /upload 上传,GET /download 下载,GET /ls 列目录,GET /stat 查 SHA256。流式传输,支持 200MB。
🔗
SSH 跳板
POST /ssh 端点把 samcommand 主机当作跳板,远程控制内网任何 SSH 主机。
🛡️
Bearer Token 鉴权
所有写操作需 Bearer token,自动生成 256 位强 token,支持 --token 自定义。
📱
跨平台 + 32位 ARM
Linux amd64/arm64/arm(含老 Android 平板)、Windows amd64、macOS amd64/arm64 全支持。

一行命令安装

自动检测平台架构,下载对应二进制到 /usr/local/bin 或 ~/.local/bin。

Linux / macOS · curl + bash
# 一行安装(自动检测 amd64/arm64/arm) curl -fsSL https://samai.cc/samcommand/downloads/install.sh | bash # 任何时候重新运行此命令即可更新到最新版
Windows · PowerShell
# 在 PowerShell 中执行(管理员装到 Program Files,否则装到 %LOCALAPPDATA%) irm https://samai.cc/samcommand/downloads/install.ps1 | iex
Termux (Android) · 老平板/手机变公网可控节点
# 在 Termux 里执行(自动检测 armv7l / aarch64) pkg install -y curl curl -fsSL https://samai.cc/samcommand/downloads/install.sh | bash # 启动 samcommand(Termux 需要 proot 包装解决 DNS 问题) echo "nameserver 8.8.8.8" > $PREFIX/etc/resolv.conf export SSL_CERT_FILE=$PREFIX/etc/tls/cert.pem proot -b $PREFIX/etc/resolv.conf:/etc/resolv.conf samcommand --no-p2p --verbose

30 秒拿到公网 URL

安装后三步走,立刻拥有一个公网可控的远程 agent。

1️⃣ 启动 samcommand

samcommand \ --subdomain my-agent \ --token $(openssl rand -hex 32) \ --verbose

启动后会打印 Public URL + Auth token,记下来。

2️⃣ 从任意设备执行命令

curl -X POST https://my-agent.t.aitun.cc/exec \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"command":"uname -a"}'

返回 JSON:exit_code, stdout, stderr, duration_ms。

3️⃣ 上传 / 下载文件

# 上传 curl -X POST 'https://my-agent.t.aitun.cc/upload?path=/tmp/x.bin' \ -H "Authorization: Bearer <token>" \ --data-binary @local.bin # 下载 curl 'https://my-agent.t.aitun.cc/download?path=/tmp/x.bin' \ -H "Authorization: Bearer <token>" -o x.bin

SHA256 自动校验,原子重命名,断点安全。

直接下载二进制

所有二进制均为静态链接,无任何运行时依赖。SHA256 校验请见 checksums-sha256.txt

平台 架构 文件 大小 下载
🐧Linux x86-64 (amd64) samcommand-linux-amd64 7.4 MB 下载
🐧Linux ARM 64-bit (arm64) samcommand-linux-arm64 6.8 MB 下载
🐧Linux ARM 32-bit v7 (armv7l) samcommand-linux-arm 7.1 MB 下载
🪟Windows x86-64 (amd64) samcommand-windows-amd64.exe 7.5 MB 下载
🍎macOS Intel (amd64) samcommand-darwin-amd64 7.5 MB 下载
🍎macOS Apple Silicon (arm64) samcommand-darwin-arm64 6.9 MB 下载
📜安装脚本 Linux / macOS install.sh 2.1 KB 下载
📜安装脚本 Windows PowerShell install.ps1 2.0 KB 下载

HTTP 端点

所有端点(除 /health)需 Authorization: Bearer <token>X-SamCommand-Token: <token> 头。

方法路径用途
GET/health存活探测(无需鉴权)
GET/info主机信息(OS、CPU、IP、运行时间)
POST/exec执行 shell 命令(Linux bash / Windows cmd)
POST/ps1执行 PowerShell 命令(仅 Windows)
POST/ssh通过 SSH 在远程主机执行命令(跳板)
GET/ls?path=...列目录
GET/stat?path=...文件信息 + SHA256
POST/upload?path=...上传文件(raw body 或 multipart)
GET/download?path=...下载文件(流式)