在 Ubuntu 上,SELinux 并不是默认启用的(Ubuntu 默认使用 AppArmor),而且 SELinux 本身没有官方“图形管理工具”(不像 Windows 有图形界面)。不过你可以通过以下方式来实现“图形化/可视化管理 SELinux”。
sestatus
如果看到:
SELinux status: disabled
说明当前 没有启用 SELinux。
sudo apt update
sudo apt install selinux selinux-utils policycoreutils
编辑配置文件:
sudo nano /etc/selinux/config
内容示例:
SELINUX=permissive
SELINUXTYPE=default
permissive:只记录不阻止
enforcing:真正启用并拦截
sudo reboot
重启后再看:
sestatus
policycoreutils-gui(最像图形界面)sudo apt install policycoreutils-gui
运行:
sudo system-config-selinux
⚠️ 注意:
sudo apt install cockpit
启动:
sudo systemctl enable --now cockpit.socket
浏览器访问:
https://localhost:9090
在 “SELinux” 页面可以:
✅ 这是目前 Ubuntu + SELinux 最实用的“图形方式”
sudo apt install setools setools-gui
运行:
seaudit
或:
apol
用于:
❗ Ubuntu 官方不支持 SELinux
✅ 更推荐:
| 方式 | 是否图形 | 推荐度 |
|---|---|---|
| system-config-selinux | ✅ | ⚠️ 难装 |
| Cockpit | ✅ Web | ⭐⭐⭐⭐ |
| setools-gui | ✅ | ⭐⭐⭐ |
| 命令行 | ❌ | ⭐⭐⭐⭐⭐ |
如果你愿意,我可以:
你想走哪条路?