Linux進階許可權ACL許可權控制基礎知識

來源:互聯網
上載者:User

1.進階許可權機制,允許檔案或檔案夾進行靈活、複雜使用權限設定
 最重要的Entry tag type, 它有以下幾個類型
 ACL_USER_OBJ: 相當於Linux裡file_owner的permission
 ACL_USER: 定義了額外的使用者可以對此檔案擁有的permission
 ACL_GROUP_OBJ: 相當於Linux裡group的permission
 ACL_GROUP: 定義了額外的組可以對此檔案擁有的permission
 ACL_MASK: 定義了ACL_USER, ACL_GROUP_OBJ和ACL_GROUP的最大許可權
 ACL_OTHER: 相當於Linux裡other的permission
 user:對應了ACL_USER_OBJ和ACL_USER
 group:對應了ACL_GROUP_OBJ和ACL_GROUP
 mask:對應了ACL_MASK
 other:對應了ACL_OTHER
 
2.需要掛載檔案系統時開啟ACL
 mount -o acl /dev/sda5 /data
 在/etc/fstab中defaults後添加acl
 根分區預設開啟acl
 
3.查看檔案或者目錄ACL許可權
 getfacl filename
 
4.設定ACL
 setfacl -m u:username:rwx filename
 -m modify
 -x 刪除,不需要跟許可權了
 u user
 g group
 
5.mask
 當給檔案設定了ACL後,檔案中間的所屬組的許可權顯示就變成了mask,而不代表所屬組的許可權了
 mask規定了ACL_USER, ACL_GROUP_OBJ和ACL_GROUP的最大許可權,多餘的許可權就無效了
 mask不影響檔案所屬使用者的許可權

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.