Files
odboy 400812d114 feat: 新增 file/svc/archive/sys/log/fw 分组并扩充 net、proc
- file:findbig 按大小、findrecent 按修改时间、findname 按名称查找文件
- svc:systemctl / launchctl / sc 统一接口,status、enable、disable、logs
- archive:按扩展名自动识别格式并解压,支持 tar.gz/tgz/tar.bz2/tar.xz/tar/zip/gz
- sysinfo:OS、CPU、内存、磁盘一览
- log:journalctl / log show / wevtutil 搜索关键字与查看最近日志
- fw:ufw / firewalld / iptables / ALF / netsh 统一接口,status、allow、deny
- net 新增 ping、trace(mtr 优先)、dns(dig 优先)、curl HTTP 诊断
- proc 新增 topmem、topcpu、killname
- 危险操作(svc enable/disable、proc killname、fw allow/deny)需 --yes 确认
- 注册表、executor 派发表、cli 分组说明与 README 同步更新
2026-11-02 22:42:18 +08:00

46 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# fw - 防火墙
统一管理 ufw / firewalld / iptables / Windows Firewall,不用记不同工具的命令。
## 命令
| 命令 | 作用 |
| --- | --- |
| `kopsc fw status` | 查看防火墙状态与规则 |
| `kopsc fw allow <端口>[/<协议>]` | 开放端口 |
| `kopsc fw deny <端口>[/<协议>]` | 关闭端口 |
## 示例
```bash
# 查看防火墙状态
kopsc fw status
# 开放 8080/tcp(默认协议)
kopsc fw allow 8080 --yes
# 开放 53/udp
kopsc fw allow 53/udp --yes
# 关闭 8080/tcp
kopsc fw deny 8080 --yes
# 也可以写成 8080/tcp 形式
kopsc fw allow 8080/tcp --yes
```
## 选项
| 选项 | 说明 |
| --- | --- |
| `-p` / `--protocol` | 协议(`tcp` 或 `udp`,默认 `tcp`) |
| 端口格式 | `8080` 或 `8080/tcp` 或 `8080/udp` |
## 平台实现
| 操作 | Linux | macOS | Windows |
| --- | --- | --- | --- |
| status | ufw / firewalld / iptables(自动检测) | ALF(应用防火墙) | `netsh advfirewall` |
| allow | `ufw allow` / `firewall-cmd --add-port` | 不支持 | `netsh advfirewall add rule` |
| deny | `ufw deny` / `firewall-cmd --remove-port` | 不支持 | `netsh advfirewall delete rule` |