← 返回
安全合规

openclaw-server-secure-skill

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(前身为 Clawdbot/Moltbot)的全面安全加固与安装指南。当用户需要加固服务器、安装 OpenClaw 代理或为代理配置 Tailscale/防火墙时,请使用此技能。
kime541200
安全合规 clawhub v1.0.0 1 版本 99634.7 Key: 无需
★ 1
Stars
📥 3,798
下载
💾 23
安装
1
版本
#latest

概述

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.

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

```

  1. 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.

  1. 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)

  1. 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.
  1. 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

```

  1. 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

  1. Install OpenClaw
    • Commands:

```bash

npm install -g openclaw && openclaw doctor

```

  1. 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"

}

```

  1. Secure Credentials
    • Goal: Restrict file permissions.
    • Commands:

```bash

chmod 700 ~/.openclaw/credentials 2>/dev/null || true

chmod 600 .env 2>/dev/null || true

```

  1. Final Audit
    • Action: Run the built-in security audit.
    • Command:

```bash

openclaw security audit --deep

```

Verification Status

Run to confirm:

sudo ufw status verbose
ss -tulnp
tailscale status
openclaw doctor

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 12:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,697
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,145
security-compliance

1password

steipete
设置和使用 1Password CLI (op)。适用于:安装 CLI、启用桌面应用集成、登录(单/多账户)、通过 op 读取/注入/运行密钥。
★ 53 📥 31,135