语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -3,11 +3,11 @@
<h2 id="补充说明">补充说明</h2>
<p><strong>chcon命令</strong> 是修改对象(文件)的安全上下文,比如:用户、角色、类型、安全级别。也就是将每个文件的安全环境变更至指定环境。使用<code>--reference</code>选项时把指定文件的安全环境设置为与参考文件相同。chcon命令位于<code>/usr/bin/chcon</code></p>
<h3 id="语法">语法</h3>
<pre><code>chcon [选项]... 环境 文件...
<pre><code class="language-bash">chcon [选项]... 环境 文件...
chcon [选项]... [-u 用户] [-r 角色] [-l 范围] [-t 类型] 文件...
chcon [选项]... --reference=参考文件 文件...</code></pre>
<h3 id="选项">选项</h3>
<pre><code>-h, --no-dereference影响符号连接而非引用的文件。
<pre><code class="language-bash">-h, --no-dereference影响符号连接而非引用的文件。
--reference=参考文件:使用指定参考文件的安全环境,而非指定值。
-R, --recursive递归处理所有的文件及子目录。
-v, --verbose为处理的所有文件显示诊断信息。
@@ -16,21 +16,21 @@ chcon [选项]... --reference=参考文件 文件...</code></pre>
-t, --type=类型:设置指定类型的目标安全环境。
-l, --range=范围:设置指定范围的目标安全环境。</code></pre>
<p>以下选项是在指定了<code>-R</code>选项时被用于设置如何穿越目录结构体系。如果您指定了多于一个选项,那么只有最后一个会生效。</p>
<pre><code>-H如果命令行参数是一个通到目录的符号链接则遍历符号链接。
<pre><code class="language-bash">-H如果命令行参数是一个通到目录的符号链接则遍历符号链接。
-L遍历每一个遇到的通到目录的符号链接。
-P不遍历任何符号链接默认
--help显示此帮助信息并退出。
--version显示版本信息并退出。</code></pre>
<h3 id="实例">实例</h3>
<p>如果你想把这个ftp共享给匿名用户的话需要开启以下</p>
<pre><code>chcon -R -t public_content_t /var/ftp</code></pre>
<pre><code class="language-bash">chcon -R -t public_content_t /var/ftp</code></pre>
<p>如果你想让你设置的FTP目录可以上传文件的话SELINUX需要设置</p>
<pre><code>chcon -t public_content_rw_t /var/ftp/incoming</code></pre>
<pre><code class="language-bash">chcon -t public_content_rw_t /var/ftp/incoming</code></pre>
<p>允许用户HHTP访问其家目录该设定限仅于用户的家目录主页</p>
<pre><code>setsebool -P httpd_enable_homedirs 1
<pre><code class="language-bash">setsebool -P httpd_enable_homedirs 1
chcon -R -t httpd_sys_content_t ~user/public_html</code></pre>
<p>如果你希望将samba目录共享给其他用户你需要设置</p>
<pre><code>chcon -t samba_share_t /directory</code></pre>
<pre><code class="language-bash">chcon -t samba_share_t /directory</code></pre>
<p>共享rsync目录时</p>
<pre><code>chcon -t public_content_t /directories</code></pre>
<pre><code class="language-bash">chcon -t public_content_t /directories</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->