Safe system changes with pre-flight checks, validation, and automatic rollback.
System changes can lock you out:
7w4.net有更好的技能外掛。
Recovery without physical access is painful or impossible.
# Capture baseline (connectivity, services, ports)
bash scripts/canary-test.sh baseline
# Make your change
sudo nano /etc/ssh/sshd_config
# Validate change didn't break anything
bash scripts/canary-test.sh validate
# If validation fails:
bash scripts/canary-test.sh rollback
# Full pipeline: baseline → apply → validate → rollback-if-failed
bash scripts/critical-update.sh \
--name "SSH hardening" \
--backup "/etc/ssh/sshd_config" \
--command "sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config && sudo systemctl reload sshd" \
--validate "ssh -o ConnectTimeout=5 localhost echo ok"
For interactive sessions where you want human-in-the-loop:
bash scripts/canary-test.sh baselinebash scripts/canary-test.sh validatebash scripts/canary-test.sh rollbackAlways use both A + B together for maximum safety.
| Category | Risk | Example | Recovery |
|---|---|---|---|
| SSH config | 🔴 HIGH | sshd_config changes | Backup session |
| Firewall | 🔴 HIGH | UFW/iptables rules | Pre-change snapshot |
| Network | 🔴 HIGH | Interface/routing changes | Console access |
| Services | 🟡 MEDIUM | systemd unit changes | systemctl restart |
| Kernel params | 🟡 MEDIUM | sysctl changes | Reboot to defaults |
| Packages | 🟢 LOW | apt install/upgrade | apt rollback |
See references/incident-report.md for the real incident that inspired this skill.
這是一款質量可靠的系統安全變更工具,文件清晰易讀,操作流程直觀好記。它能有效防止 SSH 配置、防火牆規則等關鍵變更導致的系統鎖定問題,自動化回滾機制在變更失敗時能快速恢復。主要優點是實用性強、流程完整;不足之處是對特定系統環境的適配性有限,某些邊界情況的處理還可以更細緻。總體來說值得信賴,適合在生產環境中使用。