在 Debian 里“context”这个词可能出现在不同场景,常见的是 SELinux / AppArmor 的 security context,或者是 systemd 的 security context,或者是 终端/桌面环境里的某种 context(如 ibus、输入法、语言环境)。
下面按最常见几种情况给你说明如何“禁用”。
Debian 默认 不启用 SELinux,如果你手动装了:
getenforce
Enforcing:启用Disabled:已禁用编辑:
sudo nano /etc/selinux/config
改为:
SELINUX=disabled
然后重启:
sudo reboot
Debian 默认使用 AppArmor。
sudo aa-status
例如禁用 /usr/sbin/nginx:
sudo aa-disable /etc/apparmor.d/usr.sbin.nginx
sudo systemctl disable apparmor
sudo reboot
或在 GRUB 内核参数加:
apparmor=0
例如你不想让某个服务使用 NoNewPrivileges、ProtectSystem 等:
编辑 service:
sudo systemctl edit xxx.service
注释或删除:
[Service]
# NoNewPrivileges=true
# ProtectSystem=strict
然后:
sudo systemctl daemon-reload
sudo systemctl restart xxx
ibus exit
或:
im-config -n none
例如 (base)、(venv):
conda config --set auto_activate_base false
不要 source activate,或:
deactivate
如果你能补充一下:
我可以直接给你精准的一条命令方案。