配置黑名单
配置黑名单
cat > /etc/modprobe.d/security-blacklist.conf <<'EOF'
install cramfs /bin/false
install freevxfs /bin/false
install udf /bin/false
install usb-storage /bin/false
EOF生效与验证
生效与验证
modprobe -r cramfs 2>/dev/null # 已加载的先卸载
lsmod | grep -E 'cramfs|usb_storage' # 应无输出
# 若模块在 initramfs 中(如 usb-storage):
dracut -finstall 写法比单纯 blacklist 更硬:blacklist 只挡自动加载,install /bin/false 连显式 modprobe 也拒绝。