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

linux-patcherLinux 补丁程序

Agent Skill

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

总安装

53,320

周安装

2,267

GitHub Stars

公开资料未说明

下载量

18,680
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install linux-patcher

简介

自动 Linux 服务器修补和 Docker 容器更新。当用户要求更新、修补或升级 Linux 服务器、应用安全更新、更新 Docker 容器、检查系统更新或管理跨多个主机的服务器维护时使用。支持 Ubuntu、Debian、RHEL、AlmaLinux、Rocky Linux、CentOS、Amazon Linux 和 SUSE。包括用于自动主机检测和智能 Docker 处理的 PatchMon 集成。

SKILL.md

name
linux-patcher
description
Automated Linux server patching and Docker container updates. Use when the user asks to update, patch, or upgrade Linux servers, apply security updates, update Docker containers, check for system updates, or manage server maintenance across multiple hosts. Supports Ubuntu, Debian, RHEL, AlmaLinux, Rocky Linux, CentOS, Amazon Linux, and SUSE. Includes PatchMon integration for automatic host detection and intelligent Docker handling.

Linux Patcher

Automate Linux server patching and Docker container updates across multiple hosts via SSH.

⚠️ Important Disclaimers

Distribution Support Status

Fully Tested:

  • Ubuntu - Tested end-to-end with real infrastructure

Supported but Untested:

  • ⚠️ Debian GNU/Linux - Commands based on official documentation
  • ⚠️ Amazon Linux - Supports both AL2 (yum) and AL2023 (dnf)
  • ⚠️ RHEL (Red Hat Enterprise Linux) - Supports RHEL 7 (yum) and 8+ (dnf)
  • ⚠️ AlmaLinux - RHEL-compatible, uses dnf
  • ⚠️ Rocky Linux - RHEL-compatible, uses dnf
  • ⚠️ CentOS - Supports CentOS 7 (yum) and 8+ (dnf)
  • ⚠️ SUSE/OpenSUSE - Uses zypper package manager

Testing Recommendation: Always test untested distributions in a non-production environment first. The script will warn you when running on untested distributions.

Security Notice

This skill requires:

  • Passwordless sudo access - Configured with restricted permissions
  • SSH key authentication - No passwords stored or transmitted
  • PatchMon credentials - Stored securely in user's home directory

Read SETUP.md for complete security configuration guide.

Quick Start

Automated (Recommended)

Patch all hosts from PatchMon (automatic detection):

scripts/patch-auto.sh

Skip Docker updates (packages only):

scripts/patch-auto.sh --skip-docker

Preview changes (dry-run):

scripts/patch-auto.sh --dry-run

Manual (Alternative)

Single host - packages only:

scripts/patch-host-only.sh user@hostname

Single host - full update:

scripts/patch-host-full.sh user@hostname /path/to/docker/compose

Multiple hosts from config:

scripts/patch-multiple.sh config-file.conf

Features

  • PatchMon integration - Automatically detects hosts needing updates
  • Smart Docker detection - Auto-detects Docker and Compose paths
  • Selective updates - Skip Docker updates with --skip-docker flag
  • Passwordless sudo required - Configure with visudo or /etc/sudoers.d/ files
  • SSH key authentication - No password prompts
  • Parallel execution - Update multiple hosts simultaneously
  • Dry-run mode - Preview changes without applying
  • Manual override - Run updates on specific hosts without PatchMon

Configuration

Option 1: Automatic via PatchMon (Recommended)

Configure PatchMon credentials for automatic host detection:

cp scripts/patchmon-credentials.example.conf ~/.patchmon-credentials.conf
nano ~/.patchmon-credentials.conf

Set your credentials:

PATCHMON_URL=https://patchmon.example.com
PATCHMON_USERNAME=your-username
PATCHMON_PASSWORD=your-password

Then simply run:

scripts/patch-auto.sh

The script will:

  1. Query PatchMon for hosts needing updates
  2. Auto-detect Docker on each host
  3. Apply appropriate updates (host-only or full)

Option 2: Single Host (Quick Manual)

Run scripts directly with command-line arguments (no config file needed).

Option 3: Multiple Hosts (Manual Config)

Create a config file based on scripts/patch-hosts-config.example.sh:

cp scripts/patch-hosts-config.example.sh my-servers.conf
nano my-servers.conf

Example config:

# Host definitions: hostname,ssh_user,docker_path
HOSTS=(
  "webserver.example.com,ubuntu,/opt/docker"
  "database.example.com,root,/home/admin/compose"
  "monitor.example.com,docker,/srv/monitoring"
)

# Update mode: "host-only" or "full"
UPDATE_MODE="full"

# Dry run mode (set to "false" to apply changes)
DRY_RUN="true"

Then run:

scripts/patch-multiple.sh my-servers.conf

Prerequisites

Required on Control Machine (where OpenClaw runs)

  • [ ] OpenClaw installed and running
  • [ ] SSH client installed (ssh command available)
  • [ ] Bash 4.0 or higher
  • [ ] curl installed (for PatchMon API)
  • [ ] jq installed (for JSON parsing)
  • [ ] PatchMon installed (required to check which hosts need updating)

- Does NOT need to be on the OpenClaw host - Can be installed on any server accessible via HTTPS - Download: https://github.com/PatchMon/PatchMon

Install missing tools:

# Ubuntu/Debian
sudo apt install curl jq

# RHEL/CentOS/Rocky/Alma
sudo dnf install curl jq

# macOS
brew install curl jq

Required on Target Hosts

  • [ ] SSH server running and accessible
  • [ ] SSH key authentication configured (passwordless login)
  • [ ] Passwordless sudo configured for patching commands (see SETUP.md)
  • [ ] Docker installed (optional, only for full updates)
  • [ ] Docker Compose installed (optional, only for full updates)
  • [ ] PatchMon agent installed and reporting (optional but recommended)

PatchMon Setup (Required for Automatic Mode)

PatchMon is required to automatically detect which hosts need patching.

Important: PatchMon does NOT need to be installed on the same server as OpenClaw. Install PatchMon on a separate server (can be any server on your network), and OpenClaw will query it via API.

Download PatchMon:

  • GitHub: https://github.com/PatchMon/PatchMon
  • Documentation: https://docs.patchmon.net

What you need:

  • [ ] PatchMon server installed on ANY accessible server (not necessarily the OpenClaw host)
  • [ ] PatchMon agents installed on all target hosts you want to patch
  • [ ] PatchMon API credentials (username/password)
  • [ ] Network connectivity from OpenClaw host to PatchMon server (HTTPS)

Architecture:

┌─────────────────┐      HTTPS API      ┌─────────────────┐
│ OpenClaw Host   │ ──────────────────> │ PatchMon Server │
│ (this machine)  │    Query updates    │ (separate host) │
└─────────────────┘                     └─────────────────┘
                                                  │
                                                  │ Reports
                                                  ▼
                                         ┌─────────────────┐
                                         │ Target Hosts    │
                                         │ (with agents)   │
                                         └─────────────────┘

Quick Start:

  1. Install PatchMon server on a separate server (see GitHub repo)
  2. Install PatchMon agents on all hosts you want to patch
  3. Configure OpenClaw to access PatchMon API:
cp scripts/patchmon-credentials.example.conf ~/.patchmon-credentials.conf
nano ~/.patchmon-credentials.conf  # Set PatchMon server URL
chmod 600 ~/.patchmon-credentials.conf

Detailed setup: See references/patchmon-setup.md for complete installation guide.

Can I use this skill without PatchMon? Yes! You can use manual mode to target specific hosts without PatchMon. However, automatic detection of hosts needing updates requires PatchMon.

On Target Hosts

Required:

  • SSH server running
  • Passwordless sudo for the SSH user (for apt and docker commands)
  • PatchMon agent installed and reporting (for automatic mode)

For full updates:

  • Docker and Docker Compose installed
  • Docker Compose files exist at specified paths

Configure Passwordless Sudo

On each target host, create /etc/sudoers.d/patches:

# For Ubuntu/Debian systems
username ALL=(ALL) NOPASSWD: /usr/bin/apt, /usr/bin/docker

# For RHEL/CentOS systems
username ALL=(ALL) NOPASSWD: /usr/bin/yum, /usr/bin/docker, /usr/bin/dnf

Replace username with your SSH user. Test with sudo -l to verify.

Update Modes

Host-Only Updates

Updates system packages only:

  • Run apt update && apt upgrade (or yum update on RHEL)
  • Remove unused packages (apt autoremove)
  • Does NOT touch Docker containers

When to use:

  • Hosts without Docker
  • Security patches only
  • Minimal downtime required

Full Updates

Complete update cycle:

  • Update system packages
  • Clean Docker cache (docker system prune)
  • Pull latest Docker images
  • Recreate containers with new images
  • Causes brief service interruption

When to use:

  • Docker-based infrastructure
  • Regular maintenance windows
  • Application updates available

Workflow

Automatic Workflow (patch-auto.sh)

  1. Query PatchMon - Fetch hosts needing updates via API
  2. For each host:

- SSH into host - Check if Docker is installed - Auto-detect Docker Compose path (if not specified) - Apply host-only OR full update based on Docker detection

  1. Report results - Summary of successful/failed updates

Host-Only Update Process

  1. SSH into target host
  2. Run sudo apt update
  3. Run sudo apt -y upgrade
  4. Run sudo apt -y autoremove
  5. Report results

Full Update Process

  1. SSH into target host
  2. Run sudo apt update && upgrade && autoremove
  3. Navigate to Docker Compose directory
  4. Run sudo docker system prune -af (cleanup)
  5. Pull all Docker images listed in compose file
  6. Run sudo docker compose pull
  7. Run sudo docker compose up -d (recreate containers)
  8. Report results

Docker Detection Logic

When using automatic mode:

  • Docker installed + compose file found → Full update
  • Docker installed + no compose file → Host-only update
  • Docker not installed → Host-only update
  • --skip-docker flag set → Host-only update (ignores Docker)

Docker Path Auto-Detection

When Docker path is not specified, the script checks these locations:

  1. /home/$USER/Docker/docker-compose.yml
  2. /opt/docker/docker-compose.yml
  3. /srv/docker/docker-compose.yml
  4. $HOME/Docker/docker-compose.yml
  5. Current directory

Override auto-detection:

scripts/patch-host-full.sh user@host /custom/path

Examples

Example 1: Automatic update via PatchMon (recommended)

# First time: configure credentials
cp scripts/patchmon-credentials.example.conf ~/.patchmon-credentials.conf
nano ~/.patchmon-credentials.conf

# Run automatic updates
scripts/patch-auto.sh

Example 2: Automatic with dry-run

# Preview what would be updated
scripts/patch-auto.sh --dry-run

# Review output, then apply
scripts/patch-auto.sh

Example 3: Skip Docker updates

# Update packages only, even if Docker is detected
scripts/patch-auto.sh --skip-docker

Example 4: Manual single host, packages only

scripts/patch-host-only.sh admin@webserver.example.com

Example 5: Manual single host, full update with custom Docker path

scripts/patch-host-full.sh docker@app.example.com /home/docker/production

Example 6: Manual multiple hosts from config

scripts/patch-multiple.sh production-servers.conf

Example 7: Via OpenClaw chat

Simply ask OpenClaw:

  • "Update my servers"
  • "Patch all hosts that need updates"
  • "Update packages only, skip Docker"

OpenClaw will use the automatic mode and report results.

Troubleshooting

PatchMon Integration Issues

"PatchMon credentials not found"

  • Create credentials file: cp scripts/patchmon-credentials.example.conf ~/.patchmon-credentials.conf
  • Edit with your PatchMon URL and credentials
  • Or set PATCHMON_CONFIG environment variable to custom location

"Failed to authenticate with PatchMon"

  • Verify PatchMon URL is correct (without trailing slash)
  • Check username and password
  • Ensure PatchMon server is accessible: curl -k https://patchmon.example.com/api/health
  • Check firewall rules

"No hosts need updates" but PatchMon shows updates available

  • Verify PatchMon agents are running on target hosts: systemctl status patchmon-agent
  • Check agent reporting intervals: /etc/patchmon/config.yml
  • Force agent update: patchmon-agent report

System Update Issues

"Permission denied" on apt/docker commands

  • Configure passwordless sudo (see Prerequisites section)
  • Test with: ssh user@host sudo apt update

"Connection refused"

  • Verify SSH access: ssh user@host echo OK
  • Check SSH keys are configured
  • Verify hostname resolution

Docker Compose not found

  • Specify full path: scripts/patch-host-full.sh user@host /full/path
  • Or install Docker Compose on target host
  • Auto-detection searches: /home/user/Docker, /opt/docker, /srv/docker

Containers fail to start after update

  • Check logs: ssh user@host "docker logs container-name"
  • Manually inspect: ssh user@host "cd /docker/path && docker compose logs"
  • Rollback if needed: ssh user@host "cd /docker/path && docker compose down && docker compose up -d"

PatchMon Integration (Optional)

For dashboard monitoring and scheduled patching, see references/patchmon-setup.md.

PatchMon provides:

  • Web dashboard for update status
  • Per-host package tracking
  • Security update highlighting
  • Update history

Security Considerations

  • Passwordless sudo is required for automation

- Limit to specific commands (apt, docker only) - Use /etc/sudoers.d/ files (easier to manage)

  • SSH keys should be protected

- Use passphrase-protected keys when possible - Restrict key permissions: chmod 600 ~/.ssh/id_rsa

  • Review updates before applying in production

- Use dry-run mode first - Test on staging environment

  • Schedule updates during maintenance windows

- Use OpenClaw cron jobs for automation - Coordinate with team for Docker updates (brief downtime)

Best Practices

  1. Test first - Run dry-run mode before applying changes
  2. Stagger updates - Don't update all hosts simultaneously (avoid full outage)
  3. Monitor logs - Check output for errors after updates
  4. Backup configs - Keep Docker Compose files in version control
  5. Schedule wisely - Update during low-traffic windows
  6. Document paths - Maintain config files for infrastructure
  7. Reboot when needed - Kernel updates require reboots (not automated)

Reboot Management

The scripts do NOT automatically reboot hosts. After updates:

  1. Check if reboot required: ssh user@host "[ -f /var/run/reboot-required ] && echo YES || echo NO"
  2. Schedule manual reboots during maintenance windows
  3. Use PatchMon dashboard to track reboot requirements

Integration with OpenClaw

Run Updates on Schedule

Create a cron job for automatic nightly patching:

cron add --name "Nightly Server Patching" \
  --schedule "0 2 * * *" \
  --task "cd ~/.openclaw/workspace/skills/linux-patcher && scripts/patch-auto.sh"

Or packages-only mode:

cron add --name "Nightly Package Updates" \
  --schedule "0 2 * * *" \
  --task "cd ~/.openclaw/workspace/skills/linux-patcher && scripts/patch-auto.sh --skip-docker"

Run Updates via Chat

Simply ask OpenClaw natural language commands:

Full updates (packages + Docker containers):

  • "Update my servers" ← Includes Docker by default
  • "Patch all hosts that need updates"
  • "Update all my infrastructure"

Packages only (exclude Docker):

  • "Update my servers, excluding docker"
  • "Update packages only, skip Docker"
  • "Patch hosts without touching containers"

Query status:

  • "What servers need patching?"
  • "Show me hosts that need updates"

What happens automatically:

When you say "Update my servers":

  1. ✅ Queries PatchMon for hosts needing updates
  2. ✅ Detects Docker on each host
  3. ✅ Updates system packages
  4. Pulls Docker images and recreates containers (if Docker detected)
  5. ✅ Reports results with success/failure count

When you say "Update my servers, excluding docker":

  1. ✅ Queries PatchMon for hosts needing updates
  2. ✅ Updates system packages only
  3. ❌ Skips all Docker operations (containers keep running)
  4. ✅ Reports results

Important: Docker updates are included by default for maximum automation. Use "excluding docker" to skip container updates.

Manual Override (Specific Hosts)

Target individual hosts without querying PatchMon:

  • "Update webserver.example.com"
  • "Patch database.example.com packages only"
  • "Update app.example.com with Docker"

OpenClaw will use the manual scripts for targeted updates.

Documentation Files

This skill includes comprehensive documentation:

  • SKILL.md (this file) - Overview and usage guide
  • SETUP.md - Complete setup instructions with security best practices
  • WORKFLOWS.md - Visual workflow diagrams for all modes
  • references/patchmon-setup.md - PatchMon installation and integration

First time setup? Read SETUP.md first - it provides step-by-step instructions for secure configuration.

Want to understand the flow? Check WORKFLOWS.md for visual diagrams of how the skill operates.

Supported Linux Distributions

DistributionPackage ManagerTestedStatus
Ubuntuapt✅ YesFully supported
Debianapt⚠️ NoSupported (untested)
Amazon Linux 2yum⚠️ NoSupported (untested)
Amazon Linux 2023dnf⚠️ NoSupported (untested)
RHEL 7yum⚠️ NoSupported (untested)
RHEL 8+dnf⚠️ NoSupported (untested)
AlmaLinuxdnf⚠️ NoSupported (untested)
Rocky Linuxdnf⚠️ NoSupported (untested)
CentOS 7yum⚠️ NoSupported (untested)
CentOS 8+dnf⚠️ NoSupported (untested)
SUSE/OpenSUSEzypper⚠️ NoSupported (untested)

The skill automatically detects the distribution and selects the appropriate package manager.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

89.73%
按下载量换算16,762

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills