返回顶部
o

openclaw-server-secure-skillOpenClaw安全加固

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
3,092
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

openclaw-server-secure-skill

OpenClaw 服务器安全与安装

概述

本技能指导如何搭建一个安全、自托管的 OpenClaw 实例。涵盖 SSH 加固、防火墙配置、Tailscale VPN 设置以及 OpenClaw 的安装。

工作流程

第一阶段:系统加固

  1. 1. 锁定 SSH
- 目标:仅允许密钥登录,禁止密码登录,禁止 root 登录。 - 操作:修改 /etc/ssh/sshd_config。 - 命令: bash # 备份配置 sudo cp /etc/ssh/sshdconfig /etc/ssh/sshdconfig.bak # 禁用密码认证 sudo sed -i s/^#PasswordAuthentication ./PasswordAuthentication no/ /etc/ssh/sshd_config # 禁用 root 登录 sudo sed -i s/^#PermitRootLogin ./PermitRootLogin no/ /etc/ssh/sshd_config # 重新加载 SSH sudo sshd -t && sudo systemctl reload ssh
  1. 2. 默认拒绝防火墙
- 目标:默认阻止所有入站流量。 - 操作:安装并启用 UFW。 - 命令: bash sudo apt update && sudo apt install ufw -y sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw enable

注意:如果尚未在其他接口上允许 SSH,请确保在启用前拥有控制台访问权限或备用方案,不过我们接下来会配置 Tailscale。

  1. 3. 暴力破解防护
- 目标:登录失败后自动封禁 IP。 - 操作:安装 Fail2ban。 - 命令: bash sudo apt install fail2ban -y sudo systemctl enable --now fail2ban

第二阶段:网络隐私(Tailscale)

  1. 4. 安装 Tailscale
- 目标:创建私有 VPN 网状网络。 - 命令: bash curl -fsSL https://tailscale.com/install.sh | sh sudo tailscale up

- 等待用户验证 Tailscale 链接。

  1. 5. 通过 Tailscale 配置 SSH 和 Web 服务
- 目标:仅允许来自 Tailscale 子网(100.64.0.0/10)的流量,并移除公共访问。 - 命令: bash # 允许通过 Tailscale 进行 SSH sudo ufw allow from 100.64.0.0/10 to any port 22 proto tcp # 移除公共 SSH 访问(根据需要调整规则名称/编号) sudo ufw delete allow OpenSSH || sudo ufw delete allow 22/tcp # 允许通过 Tailscale 访问 Web 端口 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. 6. 禁用 IPv6(可选)
- 目标:减少攻击面。 - 命令: 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

第三阶段:OpenClaw 安装

  1. 7. 安装 OpenClaw
- 命令: bash npm install -g openclaw && openclaw doctor
  1. 8. 配置所有者访问权限
- 必需输入: 询问用户的 Telegram ID。 - 操作:更新配置,仅将该 ID 加入白名单。 - JSON 配置目标(通过 openclaw doctor 确认位置): json { dmPolicy: allowlist, allowFrom: [YOURTELEGRAMID], groupPolicy: allowlist }
  1. 9. 保护凭证安全
- 目标:限制文件权限。 - 命令: bash chmod 700 ~/.openclaw/credentials 2>/dev/null || true chmod 600 .env 2>/dev/null || true
  1. 10. 最终审计
- 操作:运行内置安全审计。 - 命令: bash openclaw security audit --deep

验证状态

运行以下命令确认: bash sudo ufw status verbose ss -tulnp tailscale status openclaw doctor

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 openclaw-server-secure-skill-1776372041 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-server-secure-skill-1776372041 技能

通过命令行安装

skillhub install openclaw-server-secure-skill-1776372041

下载

⬇ 下载 openclaw-server-secure-skill v1.0.0(免费)

文件大小: 2.31 KB | 发布时间: 2026-4-17 15:40

v1.0.0 最新 2026-4-17 15:40
- Initial release of openclaw-server-secure-skill.
- Provides a step-by-step guide for securing and installing OpenClaw, including SSH and firewall hardening, brute-force protection, and VPN configuration with Tailscale.
- Covers OpenClaw agent installation and secure configuration.
- Includes instructions for owner access setup and running a security audit.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部