[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77VFSQ7A28PNHF5WF4WMPXZ":3,"skill-same:01M77VFSQ7A28PNHF5WF4WMPXZ":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":55,"commitSha":56,"skillDirectory":57,"forksCount":58,"repositoryHtmlUrl":59,"repositoryHomepageUrl":60,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M77VFSQ7A28PNHF5WF4WMPXZ","ssh-deploy-skill",null,"Universal SSH remote deployment tool - multi-server management, batch deployment, installation script templates with domestic mirror optimization. Supports remote installation of Git, Docker, MySQL, PostgreSQL, Nginx, Node.js, Redis, Python and more.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fs\u002Fssh-deploy-skill\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ssh-deploy-skill\ndescription: Universal SSH remote deployment tool - multi-server management, batch deployment, installation script templates with domestic mirror optimization. Supports remote installation of Git, Docker, MySQL, PostgreSQL, Nginx, Node.js, Redis, Python and more.\nwhen: Use when you need to deploy Linux servers remotely, batch install software, or manage SSH connections (install Docker, configure databases, sync files across servers)\nexamples:\n  - user: Install Docker on my server\n    assistant: Use ssh-deploy to install Docker\n  - user: Deploy environment on three servers at once\n    assistant: Use ssh-deploy for batch deployment\n  - user: Configure Aliyun mirrors on new server\n    assistant: Use ssh-deploy to set up domestic mirrors\n  - user: Upload config files to all backend servers\n    assistant: Use ssh-deploy to upload files in batch\n  - user: Run database migrations on all test servers\n    assistant: Use ssh-deploy to execute batch commands\nmetadata:\n  openclaw:\n    emoji: 🚀\n    requires:\n      python: \">=3.8\"\n      bins: [\"python3\", \"ssh\", \"scp\"]\n    install:\n      - id: paramiko\n        kind: pip\n        package: paramiko\n        label: Install paramiko (SSH library)\n---\n\n# SSH Deploy Skill\n\nA universal SSH remote deployment tool for managing Linux servers with batch operations, file transfers, and templated software installations. Optimized for domestic network environments with built-in mirror configuration for Chinese mirrors (Aliyun, Tsinghua, etc.).\n\n## Quick Start\n\n### 1. Initial Setup\n\n```bash\ncd \u002Froot\u002F.openclaw\u002Fworkspace\u002Fskills\u002Fssh-deploy-skill\n\n# Auto setup (checks dependencies, creates config)\nbash scripts\u002Fsetup.sh\n\n# Manual dependency install if auto fails\npip3 install --user paramiko\n```\n\n### 2. Configure Servers (Two Methods)\n\n#### Method A: Use inventory.json (Traditional)\n\nEdit `~\u002F.ssh-deploy\u002Finventory.json` or add servers via CLI:\n\n```bash\npython3 scripts\u002Finventory.py add web-01 \\\n  --host 192.168.1.101 \\\n  --user root \\\n  --ssh-key ~\u002F.ssh\u002Fid_rsa \\\n  --groups production,web \\\n  --tags \"aliyun\"\n```\n\n**Config location**: All server configurations are saved in `~\u002F.ssh-deploy\u002Finventory.json`.\n\n#### Method B: Read Directly from ~\u002F.ssh\u002Fconfig (New!)\n\nIf you already have Host entries in `~\u002F.ssh\u002Fconfig`, use them **without any additional configuration**:\n\n```bash\n# ~\u002F.ssh\u002Fconfig example\nHost dy-c1\n    HostName 101.126.92.30\n    User root\n    IdentityFile ~\u002F.ssh\u002Fmypc_id_rsa\n    Port 22\n\n# Execute directly using host name\npython3 scripts\u002Fdeploy.py exec dy-c1 \"ls -la \u002Fopt\"\n```\n\nThe tool automatically parses `Host`, `HostName`, `Port`, `User`, `IdentityFile` fields from your SSH config.\n\n> **Note**: Servers loaded from SSH config are **read-only** and not saved to inventory. To add groups\u002Ftags, import them: `inventory.py add --from-ssh-config`.\n\n### 3. Execute Remote Commands\n\n```bash\n# Single server\npython3 scripts\u002Fdeploy.py exec web-01 \"uptime && df -h\"\n\n# Batch by group\npython3 scripts\u002Fdeploy.py exec group:production \"docker ps\"\n\n# Batch by tag\npython3 scripts\u002Fdeploy.py exec tag:aliyun \"systemctl status nginx\"\n\n# Sequential execution (avoid high load)\npython3 scripts\u002Fdeploy.py exec group:large \"apt update\" --sequential\n```\n\n### 4. File Transfers\n\n```bash\n# Upload file\npython3 scripts\u002Fdeploy.py upload web-01 .\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\n\n# Batch upload to all group servers\npython3 scripts\u002Fdeploy.py upload group:web .\u002Fconfig.json \u002Fopt\u002Fapp\u002Fconfig.json\n\n# Download file\npython3 scripts\u002Fdeploy.py download web-01 \u002Fvar\u002Flog\u002Fnginx\u002Faccess.log .\u002Flogs\u002F\n```\n\n### 5. Use Templates for Software Installation\n\nAll templates in `templates\u002F` come pre-configured with domestic mirrors.\n\n```bash\n# Install Docker (auto-configured with China mirrors)\ncat templates\u002Finstall_docker.sh | python3 scripts\u002Fdeploy.py exec tag:docker \"bash -s\"\n\n# Install MySQL (password via environment variable)\nMYSQL_ROOT_PASSWORD=YourPass123 cat templates\u002Finstall_mysql.sh | \\\n  python3 scripts\u002Fdeploy.py exec db-01 \"bash -s\"\n\n# Base setup (system updates + mirrors)\ncat templates\u002Fbase_setup.sh | python3 scripts\u002Fdeploy.py exec group:all \"bash -s\"\n```\n\n## 📦 Installation Script Templates\n\n| Template | Software | China Mirror | Env Vars |\n|----------|----------|--------------|----------|\n| `base_setup.sh` | Base environment | ✅ | - |\n| `install_git.sh` | Git | ❌ | GIT_USER_NAME, GIT_USER_EMAIL |\n| `install_docker.sh` | Docker CE +加速器 | ✅ | - |\n| `install_mysql.sh` | MySQL 8.0 | ✅ | MYSQL_ROOT_PASSWORD |\n| `install_postgresql.sh` | PostgreSQL 15 | ✅ | PG_VERSION |\n| `install_nginx.sh` | Nginx | ❌ | - |\n| `install_nodejs.sh` | Node.js | ✅ (npm) | NODE_VERSION |\n| `install_redis.sh` | Redis | ❌ | - |\n| `install_python.sh` | Python | ✅ (pip) | PYTHON_VERSION |\n\n> **Note**: All added server configs are saved to `~\u002F.ssh-deploy\u002Finventory.json`.\n\n## 🎯 Core Features\n\n### Server Inventory Management (`inventory.py`)\n\n```bash\n# List all servers\npython3 scripts\u002Finventory.py list\n\n# Filter by group\npython3 scripts\u002Finventory.py list --group production\n\n# Filter by tag\npython3 scripts\u002Finventory.py list --tag aliyun\n\n# Add server\npython3 scripts\u002Finventory.py add SERVER_NAME \\\n  --host IP_OR_HOSTNAME \\\n  --port 22 \\\n  --user USERNAME \\\n  --ssh-key PATH_TO_KEY \\\n  --groups GROUP1,GROUP2 \\\n  --tags TAG1,TAG2 \\\n  --desc \"description\"\n```\n\n**Target Syntax** (used in `deploy.py`):\n- `server-name` - Specific server\n- `group:groupname` - All servers in that group\n- `tag:tagname` - All servers with that tag\n- `*` - All servers\n\n### Remote Command Execution (`deploy.py`)\n\n```bash\n# Parallel batch (default)\npython3 scripts\u002Fdeploy.py exec group:web \"docker pull nginx\"\n\n# Sequential (large batches or to avoid overload)\npython3 scripts\u002Fdeploy.py exec group:large \"apt upgrade -y\" --sequential\n\n# Use environment variables\nexport MYSQL_VERSION=\"8.0\"\ncat templates\u002Finstall_mysql.sh | python3 scripts\u002Fdeploy.py exec db-01 \"bash -s\"\n```\n\n### File Operations\n\n```bash\n# Upload (single)\npython3 scripts\u002Fdeploy.py upload web-01 .\u002Flocal.conf \u002Fetc\u002Fapp\u002Fconf.d\u002Fconf.conf\n\n# Batch upload\npython3 scripts\u002Fdeploy.py upload group:web .\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\n\n# Download\npython3 scripts\u002Fdeploy.py download web-01 \u002Fvar\u002Flog\u002Fapp.log .\u002Flogs\u002F\n```\n\n## 🌏 Domestic Network Optimization\n\n### Mirror Configuration\n\nThis skill uses **Aliyun mirrors by default** and configures:\n\n- **Ubuntu\u002FDebian** → `mirrors.aliyun.com`\n- **CentOS\u002FRHEL** → `mirrors.aliyun.com`\n- **npm** → `registry.npmmirror.com` (Taobao)\n- **pip** → `mirrors.aliyun.com\u002Fpypi\u002Fsimple`\n- **Docker** → USTC, NetEase, Baidu mirrors\n- **Go** → `goproxy.cn`\n- **Maven** → Aliyun repository\n\nDetailed config: `references\u002Fmirrors.md`\n\n### One-Click Mirror Setup\n\n```bash\n# Configure system mirrors on all servers\ncat templates\u002Fbase_setup.sh | python3 scripts\u002Fdeploy.py exec group:all \"bash -s\"\n\n# Manual Docker mirror config (if needed)\ncat \u003C\u003C'EOF' | python3 scripts\u002Fdeploy.py exec group:all \"bash -s\"\ncat > \u002Fetc\u002Fdocker\u002Fdaemon.json \u003C\u003CDOCKER\n{\n  \"registry-mirrors\": [\n    \"https:\u002F\u002Fdocker.mirrors.ustc.edu.cn\",\n    \"https:\u002F\u002Fhub-mirror.c.163.com\",\n    \"https:\u002F\u002Fmirror.baidubce.com\"\n  ]\n}\nDOCKER\nsystemctl restart docker\nEOF\n```\n\n## 🔒 Security Best Practices\n\n1. **SSH Key Management**\n   - Use key auth, disable passwords\n   - Key permissions: `chmod 600 ~\u002F.ssh\u002Fid_rsa`\n   - Different keys for different environments\n\n2. **Least Privilege**\n   - Create dedicated deploy users (not root)\n   - Configure passwordless sudo (only necessary commands)\n   - Server `sshd_config`: `PermitRootLogin no`, `PasswordAuthentication no`\n\n3. **Sensitive Data**\n   - Never store passwords in `inventory.json`\n   - Use environment variables for passwords (e.g., `MYSQL_ROOT_PASSWORD`)\n   - Config file permissions `640`, owner `root:appgroup`\n\n4. **Audit**\n   - Keep all deployment logs\n   - Record command, server, time, result\n\nFull security guide: `references\u002Fbest-practices.md`\n\n## 🐛 Troubleshooting\n\n### Quick Diagnostics\n\n```bash\n# 1. Network test\nping \u003Chost>\ntelnet \u003Chost> 22\n\n# 2. Manual SSH test\nssh -i ~\u002F.ssh\u002Fid_rsa root@\u003Chost> \"uptime\"\n\n# 3. View connection details\npython3 scripts\u002Fdeploy.py exec \u003Cserver> \"uptime\" 2>&1\n\n# 4. Verify key permissions\nls -la ~\u002F.ssh\u002Fid_rsa*\n```\n\n### Common Issues\n\n| Symptom | Solution |\n|---------|----------|\n| Connection refused\u002Ftimeout | Check server status, SSH service, firewall\u002Fsecurity group |\n| Permission denied (publickey) | Check public key in server's `~\u002F.ssh\u002Fauthorized_keys`, key perms 600 |\n| sudo: a password is required | Configure passwordless sudo or use root user |\n| Command not found | Use absolute path or ensure PATH includes command |\n| Slow downloads in China | Run `base_setup.sh` to configure mirrors, see `docs\u002Fmirrors.md` |\n\nDetailed troubleshooting: `references\u002Ftroubleshooting.md`\n\n## 📊 Batch Operations Examples\n\n### Scenario 1: New Server Initialization\n\n```bash\n# 1. Add server to inventory\npython3 scripts\u002Finventory.py add web-01 --host 1.2.3.101 --groups web --tags production\n\n# 2. Base setup (mirrors, tools)\ncat templates\u002Fbase_setup.sh | python3 scripts\u002Fdeploy.py exec web-01 \"bash -s\"\n\n# 3. Install core software\ncat templates\u002Finstall_docker.sh | python3 scripts\u002Fdeploy.py exec web-01 \"bash -s\"\ncat templates\u002Finstall_nginx.sh | python3 scripts\u002Fdeploy.py exec web-01 \"bash -s\"\n\n# 4. Upload app config\npython3 scripts\u002Fdeploy.py upload web-01 .\u002Fapp-config.json \u002Fopt\u002Fapp\u002Fconfig.json\n\n# 5. Start application\npython3 scripts\u002Fdeploy.py exec web-01 \"docker-compose up -d\"\n```\n\n### Scenario 2: Rolling Updates Across Multiple Servers\n\n```bash\n# Canary release: update first batch\ncat deploy-v2.sh | python3 scripts\u002Fdeploy.py exec tag:\"canary\" \"bash -s\"\n\n# Check monitoring metrics...\n\n# Full rollout\ncat deploy-v2.sh | python3 scripts\u002Fdeploy.py exec tag:production \"bash -s\"\n```\n\n### Scenario 3: Configuration Sync\n\n```bash\n# Sync config file to all Web servers\npython3 scripts\u002Fdeploy.py upload group:web .\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\n\n# Batch restart\npython3 scripts\u002Fdeploy.py exec group:web \"nginx -t && systemctl reload nginx\"\n```\n\n### Scenario 4: Health Checks & Monitoring\n\n```bash\n# Collect status from all servers\npython3 scripts\u002Fdeploy.py exec \"*\" \"uptime\" > uptime-$(date +%F).log\n\npython3 scripts\u002Fdeploy.py exec \"*\" \"df -h\" > disk-$(date +%F).log\n\npython3 scripts\u002Fdeploy.py exec \"*\" \"docker ps --format 'table {{.Names}}\\t{{.Status}}'\" > containers-$(date +%F).log\n```\n\n## 🔄 CI\u002FCD Integration\n\n### GitLab CI Example\n\n```yaml\nstages:\n  - deploy\n\ndeploy_production:\n  stage: deploy\n  script:\n    - pip3 install --user paramiko\n    - export TARGET=\"group:production\"\n    - cat deploy.sh | python3 skills\u002Fssh-deploy-skill\u002Fscripts\u002Fdeploy.py exec \"$TARGET\" \"bash -s\"\n  only:\n    - main\n```\n\n### GitHub Actions Example\n\n```yaml\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v3\n      - name: Install paramiko\n        run: pip3 install paramiko\n      - name: Deploy to servers\n        run: |\n          cat deploy.sh | python3 skills\u002Fssh-deploy-skill\u002Fscripts\u002Fdeploy.py exec \"group:staging\" \"bash -s\"\n```\n\n## 🛠️ Developer Guide\n\n### Adding New Installation Templates\n\n1. Create `.sh` file in `templates\u002F`\n2. Use `#!\u002Fbin\u002Fbash` and `set -e`\n3. Detect OS type and adapt (see existing templates)\n4. Use env vars for parameters, never hardcode secrets\n5. Add domestic mirror config where applicable\n\n### Custom Script Structure\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\necho \"===== Installing XXX =====\"\n\n# 1. Detect OS\nif [ -f \u002Fetc\u002Fdebian_version ]; then\n    OS=\"debian\"\nelif [ -f \u002Fetc\u002Fredhat-release ]; then\n    OS=\"redhat\"\nelse\n    echo \"Unsupported OS\"\n    exit 1\nfi\n\n# 2. Configure domestic mirrors (if needed)\n# ...\n\n# 3. Install software\nif [ \"$OS\" = \"debian\" ]; then\n    apt-get update\n    apt-get install -y xxx\nelif [ \"$OS\" = \"redhat\" ]; then\n    yum install -y xxx\nfi\n\n# 4. Start service\nsystemctl start xxx\nsystemctl enable xxx\n\necho \"XXX installation complete!\"\n```\n\n### Using Python API Directly\n\n```python\nfrom inventory import Inventory, Server\nfrom deploy import SSHDeployer\n\n# Load inventory\ninv = Inventory()\nserver = inv.get_server(\"web-01\")\n\n# Create deployer\ndeployer = SSHDeployer()\n\n# Execute command\nresult = deployer.execute(server, \"docker ps\")\nprint(result.success, result.output)\n\n# Upload file\nres = deployer.upload_file(server, \".\u002Flocal.conf\", \"\u002Fetc\u002Fconf.d\u002Flocal.conf\")\n\ndeployer.close()\n```\n\n## 📚 Additional Documentation\n\nDetailed documentation (some in Chinese):\n- `README.md` - Complete usage guide with API reference\n- `README.zh-CN.md` - Full Chinese manual\n- `references\u002Fmirrors.md` - Domestic mirror configuration details\n- `references\u002Fbest-practices.md` - Best practices and code examples\n- `references\u002Ftroubleshooting.md` - Complete troubleshooting handbook\n\n## 🤝 Contributing\n\nIssues and Pull Requests are welcome!\n\n## 📄 License\n\nMIT License\n","# SSH Deploy Skill\n\nA universal SSH remote deployment tool for managing Linux servers with batch operations, file transfers, and templated software installations. Optimized for domestic network environments with built-in mirror configuration for Chinese mirrors (Aliyun, Tsinghua, etc.).\n\n## Quick Start\n\n### 1. Initial Setup\n\n```bash\ncd \u002Froot\u002F.openclaw\u002Fworkspace\u002Fskills\u002Fssh-deploy-skill\n\n# Auto setup (checks dependencies, creates config)\nbash scripts\u002Fsetup.sh\n\n# Manual dependency install if auto fails\npip3 install --user paramiko\n```\n\n### 2. Configure Servers (Two Methods)\n\n#### Method A: Use inventory.json (Traditional)\n\nEdit `~\u002F.ssh-deploy\u002Finventory.json` or add servers via CLI:\n\n```bash\npython3 scripts\u002Finventory.py add web-01 \\\n  --host 192.168.1.101 \\\n  --user root \\\n  --ssh-key ~\u002F.ssh\u002Fid_rsa \\\n  --groups production,web \\\n  --tags \"aliyun\"\n```\n\n**Config location**: All server configurations are saved in `~\u002F.ssh-deploy\u002Finventory.json`.\n\n#### Method B: Read Directly from ~\u002F.ssh\u002Fconfig (New!)\n\nIf you already have Host entries in `~\u002F.ssh\u002Fconfig`, use them **without any additional configuration**:\n\n```bash\n# ~\u002F.ssh\u002Fconfig example\nHost dy-c1\n    HostName 101.126.92.30\n    User root\n    IdentityFile ~\u002F.ssh\u002Fmypc_id_rsa\n    Port 22\n\n# Execute directly using host name\npython3 scripts\u002Fdeploy.py exec dy-c1 \"ls -la \u002Fopt\"\n```\n\nThe tool automatically parses `Host`, `HostName`, `Port`, `User`, `IdentityFile` fields from your SSH config.\n\n> **Note**: Servers loaded from SSH config are **read-only** and not saved to inventory. To add groups\u002Ftags, import them: `inventory.py add --from-ssh-config`.\n\n### 3. Execute Remote Commands\n\n```bash\n# Single server\npython3 scripts\u002Fdeploy.py exec web-01 \"uptime && df -h\"\n\n# Batch by group\npython3 scripts\u002Fdeploy.py exec group:production \"docker ps\"\n\n# Batch by tag\npython3 scripts\u002Fdeploy.py exec tag:aliyun \"systemctl status nginx\"\n\n# Sequential execution (avoid high load)\npython3 scripts\u002Fdeploy.py exec group:large \"apt update\" --sequential\n```\n\n### 4. File Transfers\n\n```bash\n# Upload file\npython3 scripts\u002Fdeploy.py upload web-01 .\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\n\n# Batch upload to all group servers\npython3 scripts\u002Fdeploy.py upload group:web .\u002Fconfig.json \u002Fopt\u002Fapp\u002Fconfig.json\n\n# Download file\npython3 scripts\u002Fdeploy.py download web-01 \u002Fvar\u002Flog\u002Fnginx\u002Faccess.log .\u002Flogs\u002F\n```\n\n### 5. Use Templates for Software Installation\n\nAll templates in `templates\u002F` come pre-configured with domestic mirrors.\n\n```bash\n# Install Docker (auto-configured with China mirrors)\ncat templates\u002Finstall_docker.sh | python3 scripts\u002Fdeploy.py exec tag:docker \"bash -s\"\n\n# Install MySQL (password via environment variable)\nMYSQL_ROOT_PASSWORD=YourPass123 cat templates\u002Finstall_mysql.sh | \\\n  python3 scripts\u002Fdeploy.py exec db-01 \"bash -s\"\n\n# Base setup (system updates + mirrors)\ncat templates\u002Fbase_setup.sh | python3 scripts\u002Fdeploy.py exec group:all \"bash -s\"\n```\n\n## 📦 Installation Script Templates\n\n| Template | Software | China Mirror | Env Vars |\n|----------|----------|--------------|----------|\n| `base_setup.sh` | Base environment | ✅ | - |\n| `install_git.sh` | Git | ❌ | GIT_USER_NAME, GIT_USER_EMAIL |\n| `install_docker.sh` | Docker CE +加速器 | ✅ | - |\n| `install_mysql.sh` | MySQL 8.0 | ✅ | MYSQL_ROOT_PASSWORD |\n| `install_postgresql.sh` | PostgreSQL 15 | ✅ | PG_VERSION |\n| `install_nginx.sh` | Nginx | ❌ | - |\n| `install_nodejs.sh` | Node.js | ✅ (npm) | NODE_VERSION |\n| `install_redis.sh` | Redis | ❌ | - |\n| `install_python.sh` | Python | ✅ (pip) | PYTHON_VERSION |\n\n> **Note**: All added server configs are saved to `~\u002F.ssh-deploy\u002Finventory.json`.\n\n## 🎯 Core Features\n\n### Server Inventory Management (`inventory.py`)\n\n```bash\n# List all servers\npython3 scripts\u002Finventory.py list\n\n# Filter by group\npython3 scripts\u002Finventory.py list --group production\n\n# Filter by tag\npython3 scripts\u002Finventory.py list --tag aliyun\n\n# Add server\npython3 scripts\u002Finventory.py add SERVER_NAME \\\n  --host IP_OR_HOSTNAME \\\n  --port 22 \\\n  --user USERNAME \\\n  --ssh-key PATH_TO_KEY \\\n  --groups GROUP1,GROUP2 \\\n  --tags TAG1,TAG2 \\\n  --desc \"description\"\n```\n\n**Target Syntax** (used in `deploy.py`):\n- `server-name` - Specific server\n- `group:groupname` - All servers in that group\n- `tag:tagname` - All servers with that tag\n- `*` - All servers\n\n### Remote Command Execution (`deploy.py`)\n\n```bash\n# Parallel batch (default)\npython3 scripts\u002Fdeploy.py exec group:web \"docker pull nginx\"\n\n# Sequential (large batches or to avoid overload)\npython3 scripts\u002Fdeploy.py exec group:large \"apt upgrade -y\" --sequential\n\n# Use environment variables\nexport MYSQL_VERSION=\"8.0\"\ncat templates\u002Finstall_mysql.sh | python3 scripts\u002Fdeploy.py exec db-01 \"bash -s\"\n```\n\n### File Operations\n\n```bash\n# Upload (single)\npython3 scripts\u002Fdeploy.py upload web-01 .\u002Flocal.conf \u002Fetc\u002Fapp\u002Fconf.d\u002Fconf.conf\n\n# Batch upload\npython3 scripts\u002Fdeploy.py upload group:web .\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\n\n# Download\npython3 scripts\u002Fdeploy.py download web-01 \u002Fvar\u002Flog\u002Fapp.log .\u002Flogs\u002F\n```\n\n## 🌏 Domestic Network Optimization\n\n### Mirror Configuration\n\nThis skill uses **Aliyun mirrors by default** and configures:\n\n- **Ubuntu\u002FDebian** → `mirrors.aliyun.com`\n- **CentOS\u002FRHEL** → `mirrors.aliyun.com`\n- **npm** → `registry.npmmirror.com` (Taobao)\n- **pip** → `mirrors.aliyun.com\u002Fpypi\u002Fsimple`\n- **Docker** → USTC, NetEase, Baidu mirrors\n- **Go** → `goproxy.cn`\n- **Maven** → Aliyun repository\n\nDetailed config: `references\u002Fmirrors.md`\n\n### One-Click Mirror Setup\n\n```bash\n# Configure system mirrors on all servers\ncat templates\u002Fbase_setup.sh | python3 scripts\u002Fdeploy.py exec group:all \"bash -s\"\n\n# Manual Docker mirror config (if needed)\ncat \u003C\u003C'EOF' | python3 scripts\u002Fdeploy.py exec group:all \"bash -s\"\ncat > \u002Fetc\u002Fdocker\u002Fdaemon.json \u003C\u003CDOCKER\n{\n  \"registry-mirrors\": [\n    \"https:\u002F\u002Fdocker.mirrors.ustc.edu.cn\",\n    \"https:\u002F\u002Fhub-mirror.c.163.com\",\n    \"https:\u002F\u002Fmirror.baidubce.com\"\n  ]\n}\nDOCKER\nsystemctl restart docker\nEOF\n```\n\n## 🔒 Security Best Practices\n\n1. **SSH Key Management**\n   - Use key auth, disable passwords\n   - Key permissions: `chmod 600 ~\u002F.ssh\u002Fid_rsa`\n   - Different keys for different environments\n\n2. **Least Privilege**\n   - Create dedicated deploy users (not root)\n   - Configure passwordless sudo (only necessary commands)\n   - Server `sshd_config`: `PermitRootLogin no`, `PasswordAuthentication no`\n\n3. **Sensitive Data**\n   - Never store passwords in `inventory.json`\n   - Use environment variables for passwords (e.g., `MYSQL_ROOT_PASSWORD`)\n   - Config file permissions `640`, owner `root:appgroup`\n\n4. **Audit**\n   - Keep all deployment logs\n   - Record command, server, time, result\n\nFull security guide: `references\u002Fbest-practices.md`\n\n## 🐛 Troubleshooting\n\n### Quick Diagnostics\n\n```bash\n# 1. Network test\nping \u003Chost>\ntelnet \u003Chost> 22\n\n# 2. Manual SSH test\nssh -i ~\u002F.ssh\u002Fid_rsa root@\u003Chost> \"uptime\"\n\n# 3. View connection details\npython3 scripts\u002Fdeploy.py exec \u003Cserver> \"uptime\" 2>&1\n\n# 4. Verify key permissions\nls -la ~\u002F.ssh\u002Fid_rsa*\n```\n\n### Common Issues\n\n| Symptom | Solution |\n|---------|----------|\n| Connection refused\u002Ftimeout | Check server status, SSH service, firewall\u002Fsecurity group |\n| Permission denied (publickey) | Check public key in server's `~\u002F.ssh\u002Fauthorized_keys`, key perms 600 |\n| sudo: a password is required | Configure passwordless sudo or use root user |\n| Command not found | Use absolute path or ensure PATH includes command |\n| Slow downloads in China | Run `base_setup.sh` to configure mirrors, see `docs\u002Fmirrors.md` |\n\nDetailed troubleshooting: `references\u002Ftroubleshooting.md`\n\n## 📊 Batch Operations Examples\n\n### Scenario 1: New Server Initialization\n\n```bash\n# 1. Add server to inventory\npython3 scripts\u002Finventory.py add web-01 --host 1.2.3.101 --groups web --tags production\n\n# 2. Base setup (mirrors, tools)\ncat templates\u002Fbase_setup.sh | python3 scripts\u002Fdeploy.py exec web-01 \"bash -s\"\n\n# 3. Install core software\ncat templates\u002Finstall_docker.sh | python3 scripts\u002Fdeploy.py exec web-01 \"bash -s\"\ncat templates\u002Finstall_nginx.sh | python3 scripts\u002Fdeploy.py exec web-01 \"bash -s\"\n\n# 4. Upload app config\npython3 scripts\u002Fdeploy.py upload web-01 .\u002Fapp-config.json \u002Fopt\u002Fapp\u002Fconfig.json\n\n# 5. Start application\npython3 scripts\u002Fdeploy.py exec web-01 \"docker-compose up -d\"\n```\n\n### Scenario 2: Rolling Updates Across Multiple Servers\n\n```bash\n# Canary release: update first batch\ncat deploy-v2.sh | python3 scripts\u002Fdeploy.py exec tag:\"canary\" \"bash -s\"\n\n# Check monitoring metrics...\n\n# Full rollout\ncat deploy-v2.sh | python3 scripts\u002Fdeploy.py exec tag:production \"bash -s\"\n```\n\n### Scenario 3: Configuration Sync\n\n```bash\n# Sync config file to all Web servers\npython3 scripts\u002Fdeploy.py upload group:web .\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\n\n# Batch restart\npython3 scripts\u002Fdeploy.py exec group:web \"nginx -t && systemctl reload nginx\"\n```\n\n### Scenario 4: Health Checks & Monitoring\n\n```bash\n# Collect status from all servers\npython3 scripts\u002Fdeploy.py exec \"*\" \"uptime\" > uptime-$(date +%F).log\n\npython3 scripts\u002Fdeploy.py exec \"*\" \"df -h\" > disk-$(date +%F).log\n\npython3 scripts\u002Fdeploy.py exec \"*\" \"docker ps --format 'table {{.Names}}\\t{{.Status}}'\" > containers-$(date +%F).log\n```\n\n## 🔄 CI\u002FCD Integration\n\n### GitLab CI Example\n\n```yaml\nstages:\n  - deploy\n\ndeploy_production:\n  stage: deploy\n  script:\n    - pip3 install --user paramiko\n    - export TARGET=\"group:production\"\n    - cat deploy.sh | python3 skills\u002Fssh-deploy-skill\u002Fscripts\u002Fdeploy.py exec \"$TARGET\" \"bash -s\"\n  only:\n    - main\n```\n\n### GitHub Actions Example\n\n```yaml\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v3\n      - name: Install paramiko\n        run: pip3 install paramiko\n      - name: Deploy to servers\n        run: |\n          cat deploy.sh | python3 skills\u002Fssh-deploy-skill\u002Fscripts\u002Fdeploy.py exec \"group:staging\" \"bash -s\"\n```\n\n## 🛠️ Developer Guide\n\n### Adding New Installation Templates\n\n1. Create `.sh` file in `templates\u002F`\n2. Use `#!\u002Fbin\u002Fbash` and `set -e`\n3. Detect OS type and adapt (see existing templates)\n4. Use env vars for parameters, never hardcode secrets\n5. Add domestic mirror config where applicable\n\n### Custom Script Structure\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\necho \"===== Installing XXX =====\"\n\n# 1. Detect OS\nif [ -f \u002Fetc\u002Fdebian_version ]; then\n    OS=\"debian\"\nelif [ -f \u002Fetc\u002Fredhat-release ]; then\n    OS=\"redhat\"\nelse\n    echo \"Unsupported OS\"\n    exit 1\nfi\n\n# 2. Configure domestic mirrors (if needed)\n# ...\n\n# 3. Install software\nif [ \"$OS\" = \"debian\" ]; then\n    apt-get update\n    apt-get install -y xxx\nelif [ \"$OS\" = \"redhat\" ]; then\n    yum install -y xxx\nfi\n\n# 4. Start service\nsystemctl start xxx\nsystemctl enable xxx\n\necho \"XXX installation complete!\"\n```\n\n### Using Python API Directly\n\n```python\nfrom inventory import Inventory, Server\nfrom deploy import SSHDeployer\n\n# Load inventory\ninv = Inventory()\nserver = inv.get_server(\"web-01\")\n\n# Create deployer\ndeployer = SSHDeployer()\n\n# Execute command\nresult = deployer.execute(server, \"docker ps\")\nprint(result.success, result.output)\n\n# Upload file\nres = deployer.upload_file(server, \".\u002Flocal.conf\", \"\u002Fetc\u002Fconf.d\u002Flocal.conf\")\n\ndeployer.close()\n```\n\n## 📚 Additional Documentation\n\nDetailed documentation (some in Chinese):\n- `README.md` - Complete usage guide with API reference\n- `README.zh-CN.md` - Full Chinese manual\n- `references\u002Fmirrors.md` - Domestic mirror configuration details\n- `references\u002Fbest-practices.md` - Best practices and code examples\n- `references\u002Ftroubleshooting.md` - Complete troubleshooting handbook\n\n## 🤝 Contributing\n\nIssues and Pull Requests are welcome!\n\n## 📄 License\n\nMIT License\n",{"name":5,"when":24,"examples":25,"metadata":41,"description":7},"Use when you need to deploy Linux servers remotely, batch install software, or manage SSH connections (install Docker, configure databases, sync files across servers)",[26,29,32,35,38],{"user":27,"assistant":28},"Install Docker on my server","Use ssh-deploy to install Docker",{"user":30,"assistant":31},"Deploy environment on three servers at once","Use ssh-deploy for batch deployment",{"user":33,"assistant":34},"Configure Aliyun mirrors on new server","Use ssh-deploy to set up domestic mirrors",{"user":36,"assistant":37},"Upload config files to all backend servers","Use ssh-deploy to upload files in batch",{"user":39,"assistant":40},"Run database migrations on all test servers","Use ssh-deploy to execute batch commands",{"openclaw":42},{"emoji":43,"install":44,"requires":49},"🚀",[45],{"id":46,"kind":47,"label":48,"package":46},"paramiko","pip","Install paramiko (SSH library)",{"bins":50,"python":54},[51,52,53],"python3","ssh","scp",">=3.8","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fs\u002Fssh-deploy-skill",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill ssh-deploy-skill",{"tool":70,"command":71},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill ssh-deploy-skill",{"tool":73,"command":74},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill ssh-deploy-skill","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fs\u002Fssh-deploy-skill\u002FSKILL.md",true,[],[79,86,93,100,107,114],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]