Token导航 LogoToken导航TokenDH.com
运维敏感数据clawhub未标认证来源可访问clear审计提醒

openclaw-vps-hardeningOpenClaw VPS hardening 部署

Agent Skill

openclaw-vps-hardening 用于辅助部署、云资源、容器和基础设施运维,适合在 OpenClaw 中需要检查配置、整理部署步骤或排查环境问题时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

11,640

周安装

485

GitHub Stars

公开资料未说明

下载量

3,880
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-vps-hardening(OpenClaw VPS hardening 部署)
来源仓库:https://github.com/maverick-software/openclaw-vps-hardening
安装命令:
openclaw skills install openclaw-vps-hardening
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-vps-hardening

简介

强化运行 OpenClaw 的 VPS 安全配置。

  • 防止未经授权的访问、暴力破解和网络暴露。
  • 适用于公开部署实例的安全加固和审计。openclaw-vps-hardening 属于运维类 Skill,可作为该场景下的辅助能力补充。
  • 安装命令:openclaw skills install openclaw-vps-hardening。
  • 需确认权限范围和维护状态,避免触发服务中断或配置丢失。

SKILL.md

name
openclaw-vps-hardening
description
>

OpenClaw VPS Server Hardening

Seven-layer defense-in-depth strategy for OpenClaw agents on Hostinger VPS. Built around Cloudflare Tunnel + Access as the primary access layer — port 18789 is never exposed to the internet.

The Strategy (Cloudflare-Based)

Internet → Cloudflare Edge
             ├── Cloudflare Access (identity check — blocked if unauthenticated)
             └── Cloudflare Tunnel (outbound-only from VPS)
                   └── localhost:18789 (OpenClaw — loopback only)
                         └── OpenClaw token auth (second factor)

Internet → port 2222 (SSH — key-only, fail2ban)
Internet → port 18789 ✗ (denied by UFW — invisible to port scan)

With Cloudflare active: the VPS has one open port (SSH). Everything else is invisible.


Quick Start

Step 1 — Deploy OpenClaw first

Use the openclaw-vps-deploy skill. Get the agent running before hardening.

Step 2 — Set up Cloudflare Tunnel + Access

Use the cloudflare-agent-tunnel skill. Verify the agent is accessible at https://agent.yourdomain.com before closing port 18789.

Step 3 — Run the hardening script

# Copy script to VPS
scp scripts/harden.sh root@SERVER_IP:/tmp/harden.sh

# Dry run first — see what will change
ssh root@SERVER_IP "bash /tmp/harden.sh --dry-run"

# Apply (opens new terminal first to test SSH on new port)
ssh root@SERVER_IP "bash /tmp/harden.sh --ssh-port 2222"

Step 4 — Test before closing old session

# In a NEW terminal — verify SSH works on new port BEFORE closing old session
ssh -p 2222 root@SERVER_IP "echo OK"

# If that works, close old session. If it fails, revert:
# ssh root@SERVER_IP "cp /etc/ssh/sshd_config.bak.YYYYMMDD /etc/ssh/sshd_config && systemctl reload sshd"

The Seven Layers

Layer 1 — UFW Firewall

  • Default deny all inbound
  • Allow only SSH on custom port (default: 2222)
  • Deny 18789 explicitly (served via Cloudflare Tunnel — never public)
  • Port 18789 invisible to internet port scans

Layer 2 — SSH Hardening

  • Move SSH off port 22 (eliminates automated scanner noise)
  • Disable root login (PermitRootLogin no)
  • Key-only auth (PasswordAuthentication no)
  • Max 3 auth attempts, 30s login grace period
  • Auto-disconnect idle sessions after 10 minutes

Layer 3 — Fail2Ban

  • Protects SSH: 3 failures = 24-hour ban
  • DDoS variant: 10 attempts in 60s = 1-hour ban
  • With Cloudflare handling app layer, no custom OpenClaw filter needed

Layer 4 — OpenClaw Loopback Binding

  • Change gateway.bind from "lan" to "loopback"
  • OpenClaw listens only on 127.0.0.1 — unreachable from outside VPS
  • Even if UFW rules are wrong, direct access is impossible

Layer 5 — Unattended Security Upgrades

  • Auto-applies Ubuntu security patches
  • No automatic reboots (manual reboot control)
  • Patches CVEs without manual intervention

Layer 6 — File Permissions

  • ~/.openclaw/ → mode 700
  • openclaw.json, secrets.json → mode 600
  • ~/.cloudflared/ → mode 700, credentials → mode 600
  • SSH authorized_keys → mode 600

Layer 7 — Cloudflare Access (Identity Gate)

  • Every request requires authentication before reaching VPS
  • Supports Google SSO, email OTP, GitHub
  • Per-agent policies (each subdomain has its own allowlist)
  • Service tokens for native phone app connections (no browser flow required)
  • Free up to 50 users; $3/user/month Access-only beyond that

See references/cloudflare-access.md for full setup walkthrough including phone app service token configuration.


Cloudflare Access for Native Phone Apps

For a native mobile app connecting directly to agents without browser-based login:

  1. Create a Service Token in Zero Trust → Access → Service Auth
  2. App sends two headers on every request:
   CF-Access-Client-Id: <id>.access
   CF-Access-Client-Secret: <secret>
  1. No browser redirect, no JWT expiry — token is permanent until rotated
  2. One service token per app, revoke if compromised

See references/cloudflare-access.md → Phone App Integration for full details.


Script Options

bash harden.sh [options]

--ssh-port 2222        SSH port to open (default: 2222)
--openclaw-user koda   Service user for OpenClaw (default: koda)
--openclaw-dir /path   OpenClaw config directory (default: /root/.openclaw)
--dry-run              Print changes without applying
--skip-ufw             Skip UFW configuration
--skip-ssh             Skip SSH hardening
--skip-fail2ban        Skip Fail2Ban installation
--skip-upgrades        Skip unattended upgrades

Order of Operations (Critical)

Wrong order = lockout. Always:

  1. ✅ Deploy OpenClaw (openclaw-vps-deploy)
  2. ✅ Set up Cloudflare Tunnel + verify HTTPS access works
  3. ✅ Dry-run harden.sh
  4. ✅ Apply harden.sh
  5. ✅ Test SSH on new port in new terminal
  6. ✅ Verify agent still accessible via Cloudflare URL
  7. ✅ Close old terminal

Threat Model

See references/threat-model.md for full attack surface analysis, what each layer defends against, and residual risks.

Security posture after hardening: A- One open port (SSH). Agents invisible to port scan. Identity gate on every connection. TLS everywhere. Brute-force protection. Auto-patched OS.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

97.31%
按下载量换算3,776

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills