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
累計下載
4392
星標
1
全站排名
#2,221
全站前 44% · 「運維安全」前 47%
平台累計安裝累計下載星標評論
ClawHub ↗14742571-
SkillHub ↗14643921—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

工作流包含需要 sudo 許可權的系統級命令,可能改變 SSH、網路和防火牆配置,若操作不當會中斷管理訪問或暴露服務。執行前必須按目標作業系統和實際網路架構逐條審閱命令,確保有第二個已驗證的金鑰登入會話和控制檯恢復途徑;審查安裝指令碼來源與軟體包版本,並在變更後檢查服務、監聽埠和 Tailscale 狀態。

資料釋出於 2026-10-29

可以用來做什麼

  • 為自託管 OpenClaw 例項整理加固步驟
  • 規劃透過 Tailscale 限制管理訪問的配置
  • 建立完成變更後的 SSH、防火牆和服務核查清單

什麼時候用

  • 伺服器作業系統與網路拓撲已確認時
  • 系統級變更前具備控制檯或服務商恢復訪問時
  • 每條 sudo 命令都經過稽核且變更後能進行獨立核查時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

只為現有伺服器準備 OpenClaw 安全加固檢查清單,標出可能中斷連線的變更;不要執行任何 sudo 命令、安裝指令碼或防火牆修改。

月度資料趨勢

累計下載4392
2983374044962026-03 · 累計下載 30872026-05 · 累計下載 37662026-07 · 累計下載 40902026-08 · 累計下載 41772026-09 · 累計下載 439226-0326-09
星標1
0122026-03 · 星標 12026-05 · 星標 12026-07 · 星標 12026-08 · 星標 12026-09 · 星標 126-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094392—1
2026-084177+2.1%1
2026-074090—1
2026-053766—1
2026-033087—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),按月更新。口徑說明見資料方法。