6.6. 用户执行应用程序的布尔值
不允许 Linux 用户在其主目录中执行应用程序(继承用户权限)和具有写入访问权限的
/tmp 目录,有助于防止用户拥有的漏洞或恶意应用程序修改用户拥有的文件。
布尔值可用于更改此行为,并使用
setsebool 工具进行配置,该实用程序必须以 root 身份运行。setsebool -P 命令进行永久更改。如果您不希望在重启后保留更改,则不要使用 -P 选项:
guest_t
要防止
guest_t 域中的 Linux 用户在其主目录和 /tmp 中执行应用程序:
setsebool -P guest_exec_content off
~]# setsebool -P guest_exec_content off
xguest_t
要防止
xguest_t 域中的 Linux 用户在其主目录和 /tmp 中执行应用程序:
setsebool -P xguest_exec_content off
~]# setsebool -P xguest_exec_content off
user_t
要防止
user_t 域中的 Linux 用户在其主目录和 /tmp 中执行应用程序:
setsebool -P user_exec_content off
~]# setsebool -P user_exec_content off
staff_t
要防止
staff_t 域中的 Linux 用户在其主目录和 /tmp 中执行应用程序:
setsebool -P staff_exec_content off
~]# setsebool -P staff_exec_content off
打开
staff_exec_content 布尔值,并允许 staff_t 域中的 Linux 用户在其主目录和 /tmp 中执行应用程序:
setsebool -P staff_exec_content on
~]# setsebool -P staff_exec_content on