kime541200

openclaw-server-secure-skill

运维安全v1.0.0
作者:kime541200更新于 2026-05-17@clawhub_kime541200/openclaw-server-secure-skill
服务器运维安全扫描

据 AlphaMoat 统计,截至 2026-09,openclaw-server-secure-skill 累计下载 4,392 次、获 1 个星标,在全部 5,078 个 AI 技能中排名第 2,221 位,在「运维安全」分类(264 个)中排名第 124 位。

累计安装
147
累计下载
4,392
星标
1
全站排名
#2,221
全站前 44% · 「运维安全」前 47%
平台累计安装累计下载星标评论
ClawHub ↗1474,2571-
SkillHub ↗1464,3921—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

工作流包含需要 sudo 权限的系统级命令,可能改变 SSH、网络和防火墙配置,若操作不当会中断管理访问或暴露服务。执行前必须按目标操作系统和实际网络架构逐条审阅命令,确保有第二个已验证的密钥登录会话和控制台恢复途径;审查安装脚本来源与软件包版本,并在变更后检查服务、监听端口和 Tailscale 状态。

资料发布于 2026-10-29

可以用来做什么

  • 为自托管 OpenClaw 实例整理加固步骤
  • 规划通过 Tailscale 限制管理访问的配置
  • 建立完成变更后的 SSH、防火墙和服务核查清单

什么时候用

  • 服务器操作系统与网络拓扑已确认时
  • 系统级变更前具备控制台或服务商恢复访问时
  • 每条 sudo 命令都经过审核且变更后能进行独立核查时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

只为现有服务器准备 OpenClaw 安全加固检查清单,标出可能中断连接的变更;不要执行任何 sudo 命令、安装脚本或防火墙修改。

月度数据趋势

累计下载4,392
2,9833,7404,4962026-03 · 累计下载 3,0872026-05 · 累计下载 3,7662026-07 · 累计下载 4,0902026-08 · 累计下载 4,1772026-09 · 累计下载 4,39226-0326-09
星标1
0122026-03 · 星标 12026-05 · 星标 12026-07 · 星标 12026-08 · 星标 12026-09 · 星标 126-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,392—1
2026-084,177+2.1%1
2026-074,090—1
2026-053,766—1
2026-033,087—1

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

4.0 KB · ClawHub v1.0.0
---
name: openclaw-server-secure-skill
description: Comprehensive security hardening and installation guide for OpenClaw (formerly Clawdbot/Moltbot). Use this skill when the user wants to secure a server, install the OpenClaw agent, or configure Tailscale/Firewall for the agent.
---

# OpenClaw Server Security & Installation

## Overview
This skill guides the setup of a secure, self-hosted OpenClaw instance. It covers SSH hardening, Firewall configuration, Tailscale VPN setup, and the OpenClaw installation itself.
展开全部(共 129 行)
## Workflow

### Phase 1: System Hardening

1. **Lock down SSH**
    - Goal: Keys only, no passwords, no root login.
    - Action: Modify `/etc/ssh/sshd_config`.
    - Commands:
      ```bash
      # Backup config
      sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
      # Disable Password Auth
      sudo sed -i 's/^#*PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config
      # Disable Root Login
      sudo sed -i 's/^#*PermitRootLogin .*/PermitRootLogin no/' /etc/ssh/sshd_config
      # Reload SSH
      sudo sshd -t && sudo systemctl reload ssh
      ```

2. **Default-deny Firewall**
    - Goal: Block everything incoming by default.
    - Action: Install and enable UFW.
    - Commands:
      ```bash
      sudo apt update && sudo apt install ufw -y
      sudo ufw default deny incoming
      sudo ufw default allow outgoing
      sudo ufw enable
      ```
      *Note: Ensure you have console access or a fallback before enabling if SSH is not yet allowed on another interface, though we configure Tailscale next.*

3. **Brute-force Protection**
    - Goal: Auto-ban IPs after failed login attempts.
    - Action: Install Fail2ban.
    - Commands:
      ```bash
      sudo apt install fail2ban -y
      sudo systemctl enable --now fail2ban
      ```

### Phase 2: Network Privacy (Tailscale)

4. **Install Tailscale**
    - Goal: Create a private VPN mesh network.
    - Commands:
      ```bash
      curl -fsSL https://tailscale.com/install.sh | sh
      sudo tailscale up
      ```
    - *Wait for user to authenticate the Tailscale link.*

5. **Configure SSH & Web via Tailscale**
    - Goal: Allow traffic only from the Tailscale subnet (100.64.0.0/10) and remove public access.
    - Commands:
      ```bash
      # Allow SSH over Tailscale
      sudo ufw allow from 100.64.0.0/10 to any port 22 proto tcp
      # Remove public SSH access (Adjust rule name/number as needed)
      sudo ufw delete allow OpenSSH || sudo ufw delete allow 22/tcp
      # Allow Web ports over Tailscale
      sudo ufw allow from 100.64.0.0/10 to any port 443 proto tcp
      sudo ufw allow from 100.64.0.0/10 to any port 80 proto tcp
      ```

6. **Disable IPv6 (Optional)**
    - Goal: Reduce attack surface.
    - Commands:
      ```bash
      sudo sed -i 's/IPV6=yes/IPV6=no/' /etc/default/ufw
      if ! grep -q "net.ipv6.conf.all.disable_ipv6 = 1" /etc/sysctl.conf; then
        echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
      fi
      sudo sysctl -p && sudo ufw reload
      ```

### Phase 3: OpenClaw Installation

7. **Install OpenClaw**
    - Commands:
      ```bash
      npm install -g openclaw && openclaw doctor
      ```

8. **Configure Owner Access**
    - **Required Input:** Ask the user for their **Telegram ID**.
    - Action: Update the config to allowlist only that ID.
    - JSON Config Target (verify location via `openclaw doctor`):
      ```json
      { 
        "dmPolicy": "allowlist", 
        "allowFrom": ["YOUR_TELEGRAM_ID"], 
        "groupPolicy": "allowlist" 
      }
      ```

9. **Secure Credentials**
    - Goal: Restrict file permissions.
    - Commands:
      ```bash
      chmod 700 ~/.openclaw/credentials 2>/dev/null || true
      chmod 600 .env 2>/dev/null || true
      ```

10. **Final Audit**
    - Action: Run the built-in security audit.
    - Command:
      ```bash
      openclaw security audit --deep
      ```

## Verification Status
Run to confirm:
```bash
sudo ufw status verbose
ss -tulnp
tailscale status
openclaw doctor
```

「运维安全」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。