Linux大資料開發基礎:第三節:使用者和組
http://blog.csdn.net/lovehuangjiaju/article/details/47904673
本節主要內容
- 理解使用者和組的概念
- 使用者管理
- 組管理
- 許可權分配
1. 理解使用者和組的概念
在第一講中我們提到,linux是一種多工、多使用者的作業系統,在講ls -l命令列我們看到如下檔案詳細資訊:
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">ls</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">l</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">total</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Desktop</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Documents</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Downloads</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">179</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">21:53</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">examples</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">desktop</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">30</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:28</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:29</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: bopder-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">16:51</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">literature</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Music</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Pictures</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">15:52</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Public</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Templates</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Videos</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li></ul>
這其中便涉及到使用者和組的許可權問題,在講這部分內容之前呢,先來理解一下使用者和組的概念
在Linux中,使用者是能夠獲取系統資源的許可權的集合,組是許可權的容器。
Linux使用者型別
部分內容來源於:http://www.2cto.com/os/201404/293172.html
使用者型別 | 描述 |
---|---|
管理員 root | 具有使用系統所有許可權的使用者,其UID 為0 |
普通使用者 | 即一般使用者,其使用系統的許可權受限,其UID為500-60000之間. |
系統使用者 | 保障系統執行的使用者,一般不提供密碼登入系統,其UID為1-499之間 |
與Linux使用者資訊相關的檔案有兩個,分別是/etc/passwd, /etc/shadow
/etc/passwd檔案內容如下:
<code class="hljs ruby has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home/xtwy</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># more /etc/passwd</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">root:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:root</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/root</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/bin/bash</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">bin:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:bin</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/bin</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/bin/sh</span> ........................ <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">xtwy:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1000</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1000</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:Ubuntu-</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">10.04</span>,,,<span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home/xtwy</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/bin/bash</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>
/etc/passwd檔案內容格式為:
<code class="hljs ruby has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">account:password:<span class="hljs-constant" style="box-sizing: border-box;">UID</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:GID</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:GECOS</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:diretory</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:shell</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
account: 使用者名稱或帳號
password :使用者密碼佔位符
UID:使用者的ID號
GID:使用者所在組的ID號
GECOS:使用者的詳細資訊(如姓名,年齡,電話等)
diretory:使用者所的主目錄
shell:使用者所在的程式設計環境
/etc/shadow檔案內容格式為:
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root:$1$</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">TZS2yur$uQ3</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">5XLbdEhLkak9HKqZx/:16042:0:99999:7:空白:空白:空白</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">5</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">6</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">7</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">8</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">9</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">保留欄位,目前為空</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">使用者過期日期(單位/天),此欄位指定了使用者作廢的天數(從1970年的1月1日至今天數)</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">在口令過期之後多少天禁用此使用者</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">提前多少天警告使用者口令將過期</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">兩次修改口令間隔最多的天數</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">兩次修改口令間隔最少的天數</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">上次修改密碼的時間(單位/天),自1970年01月01日至今天數</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">使用者密碼(對應/etc/passwd檔案內的密碼佔位符),如果密碼新增“!!”表示禁用該使用者</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">使用者名稱(對應/etc/passwd檔案內的使用者名稱)</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">注:其中欄位4、5、6、7、8的值為空時,賬號可永久使用</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li></ul>
Linux使用者組型別
使用者組型別 | 描述 |
---|---|
普通使用者組 | 可以加入多個使用者 |
系統組 | 一般加入一些系統使用者 |
私有組(也稱基本組) | 當建立使用者時,如果沒有為其指明所屬組,則就為其定義一個私有的使用者組,起名稱與使用者名稱同名,當把其他使用者加入到該組中,則其就變成了普通組 |
前面我提到,組是許可權的容器,如普通使用者 user1,user2, user3所屬組group,則它們會繼承組group的許可權,與group相關的檔案包括/etc/group /etc/gshadow
下面給出的是/etc/group檔案內容及格式含義
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root:x:0:root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">額外組(可以多個用“</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">,</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">”隔開)</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">組ID(GID)</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">組密碼佔位符</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">組名</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li></ul>
下面給出的是/etc/gshadow檔案內容及格式含義
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root:空白:空白:root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">以逗號分隔的小組成員</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">以逗號分隔的組管理員</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">加密的密碼</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">|</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">組名</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>
2. 使用者管理
Linux中的使用者管理主要涉及到使用者賬號的新增、刪除和修改。所有操作都影響/etc/passwd中的檔案內容
(1)新增使用者 useradd
<code class="hljs ruby has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">useradd [options] username options: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>.-u :<span class="hljs-constant" style="box-sizing: border-box;">UID</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span>.-g :<span class="hljs-constant" style="box-sizing: border-box;">GID</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">3</span>.-d :指定使用者家目錄,預設是/home/username <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4</span>.-s :指定使用者所在的shell環境 <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span>.-<span class="hljs-constant" style="box-sizing: border-box;">G</span>:指定使用者的附加組 例子: root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home/xtwy</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># useradd -u 1988 -g 1000 john</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home/xtwy</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># tail -1 /etc/passwd</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">john:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1988</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1000</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home/john</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/bin/sh</span> 新增完成後可以採用下列命令進行使用者john密碼的修改 xtwy<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:~</span><span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">$ </span>sudo passwd john [sudo] password <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">xtwy:</span> <span class="hljs-constant" style="box-sizing: border-box;">Enter</span> new <span class="hljs-constant" style="box-sizing: border-box;">UNIX</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">password:</span> <span class="hljs-constant" style="box-sizing: border-box;">Retype</span> new <span class="hljs-constant" style="box-sizing: border-box;">UNIX</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">password:</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">passwd:</span> password updated successfully </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li></ul>
登出使用者,重新到登入介面時,便會出現john使用者的登入選項
(2)修改使用者 usermod
<code class="hljs bash has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">usermod [options] username options: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>.-u :UID <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span>.-g :GID <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">3</span>.<span class="hljs-operator" style="box-sizing: border-box;">-d</span> :指定使用者家目錄,預設是/home/username -m 與-b 一起用表示把使用者家目錄的內容也移走 <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4</span>.<span class="hljs-operator" style="box-sizing: border-box;">-s</span> :指定使用者所在的shell環境 <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span>.-G:指定使用者的附加組 使用示例: //將前面的/bin/sh,改/bin/bash root@ubuntu:/home/john<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># usermod -s /bin/bash john</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li></ul>
(3)刪除使用者 userdel
刪除使用者時,使用者不能處於登入狀態:
<code class="hljs ruby has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">userdel [options]username options <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>.-r :連同主目錄一起刪除 使用示例: root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home/xtwy</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># userdel -r john</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home/xtwy</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># cd ..</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># ls</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li></ul>
3. 組管理
前面我們知道,組是許可權的集合。在linux系統中,每個使用者都有一個使用者組,沒有指定時都預設為私有組,私有組名同使用者名稱一致,建立使用者組的好處是系統能對一個使用者組中的所有使用者的操作許可權進行集中管理。組管理涉及組的新增、刪除和修改。組的增加、刪除和修改實際上就對/etc/group檔案的更新。
(1)新增使用者組
<code class="hljs mel has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">groupadd [options] 使用者組名 options: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> -g GID:指定新使用者組的組標識號(GID)。 使用示例: <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//建立使用者組前的/etc/group檔案內容</span> oot<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span>:/home# tail /etc/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">group</span> ..................... xtwy:x:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1000</span>: sambashare:x:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">122</span>:xtwy <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//使用預設增加使用者組</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span>:/home# groupadd john <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//新增使用者組後得到的/etc/group檔案內容</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//可以看到預設使用者組gid是自增長的</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span>:/home# tail /etc/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">group</span> ................. xtwy:x:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1000</span>: sambashare:x:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">122</span>:xtwy john:x:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1001</span>: <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//指定gid</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span>:/home# groupadd -g <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1011</span> john1 root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span>:/home# tail /etc/<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">group</span> ................ john:x:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1001</span>: john1:x:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1011</span>: </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li><li style="box-sizing: border-box; padding: 0px 5px;">21</li><li style="box-sizing: border-box; padding: 0px 5px;">22</li><li style="box-sizing: border-box; padding: 0px 5px;">23</li><li style="box-sizing: border-box; padding: 0px 5px;">24</li><li style="box-sizing: border-box; padding: 0px 5px;">25</li><li style="box-sizing: border-box; padding: 0px 5px;">26</li></ul>
(2)修改使用者組
<code class="hljs ruby has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">groupmod [options] 使用者組名 options: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> -g <span class="hljs-constant" style="box-sizing: border-box;">GID</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span> 為使用者組指定新的組標識號。 <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span> -n <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span> 將使用者組的名字改為新名字 使用示例: root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># groupmod -g 1002 -n john2 john1</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># tail /etc/group</span> ..................... <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">john:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1001</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">john2:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1002</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li></ul>
(3)刪除使用者組
<code class="hljs ruby has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">groupdel 使用者組名 使用示例: root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># groupdel john2</span> root<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@ubuntu</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:/home</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># tail /etc/group</span> .................... <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">xtwy:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1000</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">sambashare:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">122</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:xtwy</span> <span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">john:</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">x:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1001</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li></ul>
4. 許可權分配 ##
(1)許可權說明
在本節第一節,我們提到ls -l命令顯示的檔案或目錄詳細資訊具有如下格式
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">ls</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">l</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">total</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Desktop</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Documents</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Downloads</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">179</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">21:53</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">examples</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">desktop</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">30</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:28</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:29</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">16:51</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">literature</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li></ul>
現在我們對ls -l顯示的內容進行分解,首先來看前半部分
首先是檔案型別,-表示文字檔案,d表示目錄,除此之外還有下列幾種檔案(不常見):
code | File Type |
---|---|
- | Standard file |
d | Standard directory |
l | Symbolic link (a shortcut to another file) |
s | Socket (a file designed to send and receive data over a network) |
c | Character device (a hardware device driver, usually found in /dev) |
b | Block device (a hardware device driver, usually found in /dev) |
後面緊跟著的是使用者許可權、組許可權及其它許可權,其中r表示讀許可權,w表示寫許可權,x表示可執行許可權,
再後面的數字表示的是連結數,這個放到下一節中介紹
緊接著是檔案或目錄的所屬者,所屬使用者組,檔案大小(位元組數),檔案最後訪問時間,檔名。
下面具體說明:
<code class="hljs avrasm has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">//hello1<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.txt</span>是一個普通檔案 //root使用者具有讀寫許可權,但不能執行 //使用者組root具有讀許可權,無寫和執行許可權 //其它使用者只有讀許可權,無寫和執行許可權 -rw-r--r-- <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> root root <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">08</span>-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">22</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">17</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">28</span> hello1<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.txt</span> //下面的程式碼演示了前面的內容 xtwy@ubuntu:~$ ls Desktop Downloads hello1<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.txt</span> literature Pictures Templates Documents examples<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.desktop</span> hello<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.txt</span> Music Public Videos xtwy@ubuntu:~$ more hello1<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.txt</span> hello linux hello linux linux xtwy@ubuntu:~$ echo <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"test permission"</span> >> hello1<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.txt</span> <span class="hljs-label" style="box-sizing: border-box;">bash:</span> hello1<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.txt</span>: Permission denied </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li></ul>
<code class="hljs lasso has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//Desktop是一個目錄</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//使用者xtwy具有讀寫和執行許可權,這裡面的執行許可權x表示可以訪問目錄</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//用用組xtwy具有讀和執行許可權,無寫許可權</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//其它使用者具有讀和執行許可權,無寫許可權</span> drwxr<span class="hljs-attribute" style="box-sizing: border-box;">-xr</span><span class="hljs-attribute" style="box-sizing: border-box;">-x</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span> xtwy xtwy <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4096</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span><span class="hljs-subst" style="color: rgb(0, 0, 0); box-sizing: border-box;">-</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">08</span><span class="hljs-subst" style="color: rgb(0, 0, 0); box-sizing: border-box;">-</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">23</span>:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">31</span> Desktop</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>
(2)修改檔案或目錄許可權
1 增加許可權
<code class="hljs haml has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//chmod命令,a表示所有,包括使用者、組及其它使用者都有增加寫許可權</span> root@ubuntu:/home/xtwy# chmod a+w hello1.txt root@ubuntu:/home/xtwy# ls -l total 48 drwxr-xr-x 2 xtwy xtwy 4096 2015-08-20 23:31 Desktop drwxr-xr-x 2 xtwy xtwy 4096 2015-08-20 23:31 Documents drwxr-xr-x 2 xtwy xtwy 4096 2015-08-20 23:31 Downloads -<span class="ruby" style="box-sizing: border-box;">rw-r--r-- <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> xtwy xtwy <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">179</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>-08-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">21</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">53</span> examples.desktop </span>-<span class="ruby" style="box-sizing: border-box;">rw-rw-rw- <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> root root <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>-08-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">22</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">17</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">28</span> hello1.txt </span>-<span class="ruby" style="box-sizing: border-box;">rw-r--r-- <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> root root <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">48</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2015</span>-08-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">22</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">17</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">29</span> hello.txt </span>drwxr-xr-x 3 root root 4096 2015-08-22 16:51 literature drwxr-xr-x 2 xtwy xtwy 4096 2015-08-20 23:31 Music drwxr-xr-x 2 xtwy xtwy 4096 2015-08-20 23:31 Pictures drwxr-xr-x 3 xtwy xtwy 4096 2015-08-22 15:52 Public drwxr-xr-x 2 xtwy xtwy 4096 2015-08-20 23:31 Templates drwxr-xr-x 2 xtwy xtwy 4096 2015-08-20 23:31 Videos </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li></ul>
2 減小許可權
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//減小許可權,用減號表示</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">chmod</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">a</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">w</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">ls</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">l</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">total</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Desktop</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Documents</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Downloads</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">179</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">21:53</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">examples</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">desktop</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">30</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:28</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:29</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">16:51</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">literature</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Music</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Pictures</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">15:52</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Public</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Templates</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Videos</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li></ul>
3 給當前使用者增加許可權
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//不加all表示作用於當前使用者</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">chmod</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">+</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">w</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">ls</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">l</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">total</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Desktop</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Documents</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Downloads</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">179</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">21:53</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">examples</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">desktop</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">30</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:28</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:29</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">16:51</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">literature</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Music</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Pictures</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">15:52</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Public</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style=color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Templates</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Videos</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li></ul>
4 靈活設定許可權,採用數字方式
讀、寫、執行三項許可權可以用數字表示,就是r=4,w=2,x=1
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//使用者具有讀寫許可權</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//使用者組和其它使用者具有執行許可權,無讀寫許可權</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">chmod</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">611</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root@ubuntu:/home/xtwy#</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">ls</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">l</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">total</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Desktop</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Documents</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Downloads</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">179</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">21:53</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">examples</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">desktop</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">30</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:28</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">r</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">48</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:29</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">16:51</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">literature</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Music</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Pictures</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">3</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">15:52</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Public</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Templates</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">drwxr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xr</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">4096</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">20</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:31</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">Videos</span> </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li></ul>
5 改變使用者 chown
將root擁有改xtwy使用者擁有
<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">-rw<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">---x--x 1 root root 30 2015-08-22 17:28 hello1.txt</span> root@ubuntu:/home/xtwy<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># chown xtwy hello1.txt</span> -rw<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">---x--x 1 xtwy root 30 2015-08-22 17:28 hello1.txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"> //修改完成後可以對檔案中的內容進行修改</span> root@ubuntu:/home/xtwy<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># su xtwy</span> xtwy@ubuntu:~$ echo <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"test permissions"</span> >> hello1.txt </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li></ul>
6 改變使用者組 chgrp
<code class="hljs brainfuck has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">root</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">30</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">17:28</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy@ubuntu:~$</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">chgrp</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span> <span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">rw</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">x</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">1</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">xtwy</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">47</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">2015</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">08</span><span class="hljs-literal" style="color: rgb(0, 102, 102); box-sizing: border-box;">-</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">22</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">23:43</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">hello1</span><span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">.</span><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">txt</span></code>
相關文章
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第三節:使用者和組2015-11-14SparkLinux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第七節:程式管理2015-11-14SparkLinux大資料
- Linux大資料開發基礎:第四節:Linux檔案系統(二)2016-01-04Linux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第八節:網路管理2015-11-14SparkLinux大資料
- Linux大資料開發基礎:第五節:vi、vim編輯器(一)2016-01-04Linux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第四節:Linux檔案系統(二)2015-11-14SparkLinux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第十五節:基礎正規表示式(一)2015-11-15SparkLinux大資料
- Linux基礎之使用者和組2024-04-30Linux
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第五節:vi、vim編輯器(一)2015-11-14SparkLinux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第六節:vi、vim編輯器(二)2015-11-14SparkLinux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第一節、Linux介紹、安裝及使用初步2015-11-14SparkLinux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第二節:Linux檔案系統、目錄(一)2015-11-14SparkLinux大資料
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第九節:Shell程式設計入門(一)2015-11-14SparkLinux大資料程式設計
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第十節:Shell程式設計入門(二)2015-11-14SparkLinux大資料程式設計
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第十二節:Shell程式設計入門(四)2015-11-14SparkLinux大資料程式設計
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第十三節:Shell程式設計入門(五)2015-11-14SparkLinux大資料程式設計
- Spark修煉之道(基礎篇)——Linux大資料開發基礎:第十四節:Shell程式設計入門(六)2015-11-15SparkLinux大資料程式設計
- Linux入門_基礎命令_使用者和組相關命令2020-11-16Linux
- 大資料基礎之開發第一個Java程式2019-04-22大資料Java
- 大資料學習之Linux基礎2019-10-15大資料Linux
- 大資料之MySQL基礎(含Linux)2016-12-23大資料MySqlLinux
- Java基礎 第三節 第五課2020-11-28Java
- Java基礎 第三節 第七課2020-11-28Java
- Java基礎 第三節 第六課2020-11-28Java
- Java基礎 第三節 第一課2020-11-27Java
- Java基礎 第二節 第三課2020-11-24Java
- Java基礎 第三節 第十課2020-11-29Java
- 大資料之JAVA基礎(一):資料和變數2018-03-22大資料Java變數
- 大資料——HBase基礎2020-09-24大資料
- 有基礎學習大資料開發好不好入門2021-03-22大資料
- 學大資料開發要掌握的基礎知識有哪些?2023-12-08大資料
- 大資料:大資料之基礎語法2020-03-11大資料
- 第 4 節:基礎資料型別2019-11-15資料型別
- Java基礎 第三節 第二十課2020-12-05Java
- 轉型進入IT行業,0基礎學習大資料開發需要什麼基礎?2019-08-02行業大資料
- 零基礎的人可以去大資料培訓機構學習大資料開發嗎?2018-08-11大資料
- 入門大資料開發行業!必備的十大基礎2018-12-22大資料行業
- 大資料學習方法,學大資料需要的基礎和路線2019-07-11大資料