Liunx基礎-檔案的許可權管理

來源:互聯網
上載者:User

標籤:blank   target   display   style   使用者組   

1.Linux每個檔案中,分為使用者,使用者組和其他人三種身份。在ls -l顯示的檔案屬性中,第一位顯示的是檔案的類型,接下來三個為一組共三組,分別代表使用者,使用者組,其他人的許可權,有r,w,x三種。
??

650) this.width=650;" title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://img1.51cto.com/attachment/201407/17/51403_1405606328E3oG.png" "568" height="30" />

如所示,第一位橫杠代表是一個檔案,後面三位分別代表了檔案的使用者,使用者組和其他人的許可權。

使用者權限為rwx=讀寫執行,使用者組許可權為r-x=讀和執行,其他人許可權為r-x=讀和執行。

 

2.注意,當要開放目錄給任何人瀏覽時,至少要給予r和x的許可權,但是w寫入許可權不可以隨便賦予。

 

3.利用chmod可以變更檔的許可權,譬如,需要將/tmp/bin目錄下面的unlink檔案改為使用者權限為讀寫執行,使用者組許可權為讀寫, 其他人許可權為讀,我們可以使用命令

   chmod 764 來更改許可權。

650) this.width=650;" title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://img1.51cto.com/attachment/201407/17/51403_140560632848Zi.png" "561" height="50" />

650) this.width=650;" title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://img1.51cto.com/attachment/201407/17/51403_1405606328Gj22.png" "572" height="37" />

許可權更改成功,許可權更改後顯示了我們想要的許可權。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.