uTools-Manuals/docs/linux/sesearch.html
2019-04-21 11:50:48 +08:00

19 lines
1.4 KiB
HTML
Raw 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.

<h1 id="sesearch">sesearch</h1>
<p>查询SELinux策略的规则详情</p>
<h2 id="补充说明">补充说明</h2>
<p>使用seinfo命令可以查询SELinux的策略提供多少相关规则如果查到的相关类型或者布尔值想要知道详细规则时使用 <strong>sesearch命令</strong> 查询。SELinux的策略与规则管理相关命令seinfo命令、sesearch命令、getsebool命令、setsebool命令、semanage命令。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">sesearch [-a] [-s 主体类型] [-t 目标类型] [-b 布尔值]</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-a:列出该类型或布尔值的所有相关信息
-t:后面还要接类型,例如 -t httpd_t
-b:后面还要接布尔值的规则,例如 -b httpd_enable_ftp_server</code></pre>
<h3 id="实例">实例</h3>
<p>找出目标文件资源类型为<code>httpd_sys_content_t</code>的有关信息:</p>
<pre><code class="language-bash">sesearch -a -t httpd_sys_content_t</code></pre>
<p>找出主体进程为<code>httpd_t</code>且目标文件类型为httpd相关的所有信息</p>
<pre><code class="language-bash">sesearch -s httpd_t -t httpd_* -a</code></pre>
<p>查看布尔值<code>httpd_enable_homedirs</code>设置了多少规则</p>
<pre><code class="language-bash">sesearch -b httpd_enable_homedirs -a</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->