linux2 2控制對檔案的訪問

2021-07-30 03:08:47 字數 1956 閱讀 5675

2.1控制對檔案的訪問

1.許可權列表的讀取

[root@localhost desktop]# getfacl file

# file: file   ##

檔名稱

# owner: root   ##

檔案所有人

# group: root   ##

檔案所有組

user::rw-   ##

使用者許可權

user:student:rwx   ##

特殊指派

student

使用者及其許可權

group::r--   ##

組許可權mask::rwx   ##

可指派最大許可權

other::r--   ##

其他人的許可權 2.

setfacl

用於設定或修改檔案的

aclsetfacl -m u:bob:rw filename           ##

授予使用者

bob讀寫許可權

setfacl -m g:westos:rw filename    ##

授予組westos

讀寫許可權

setfacl -m g:redhat:r filename         ##

授予組redhat

讀的許可權

setfacl -x u:bob filename                  ##

刪除使用者

bob的

acl許可權

setfacl -m o::- filename                    ##

修改其他所有人的許可權為空

[root@localhost desktop]# setfacl -m u:bob:rw file

[root@localhost desktop]# setfacl -m g:westos:rw file

[root@localhost desktop]# setfacl -m g:redhat:r file

[root@localhost desktop]# getfacl file

# file: file                                       ##

檔名稱

file

# owner: root                               ##

檔案所有人

root

# group: root                                ##

檔案所有組

root

user::rw-                                       ##

所有人許可權讀寫

user:student:rwx                         ##

特殊指派

student

使用者及讀寫執行許可權

user:bob:rw-                                ##

特殊指派

bob使用者及讀寫許可權

group::r--                                       ##

所有組許可權讀

group:westos:rw-                        ##

特殊指派

westos

組及讀寫許可權

group:redhat:r--                           ##

特殊指派

redhat

組及讀許可權

mask::rwx                                     ##

可指派最大許可權讀寫執行

other::r--                                        ##

其他人許可權讀

unit2 2控制對檔案的訪問

unit2 控制對檔案的訪問 一,許可權列表的讀取 kiosk foundation0 desktop getfacl file file file 檔名稱 owner kiosk 檔案所有人 group kiosk 檔案所有組 user rw 使用者許可權 user kiosk rwx 特殊指派使...

控制對檔案的訪問

第二單元 控制對檔案的訪問 截圖檢視17日1 31 檔案系統 是os用於明確儲存裝置 如硬碟 或分割槽上的檔案和資料結構 即在儲存裝置上組織檔案的方法。os中負責管理和儲存檔案資訊的軟體機構稱為檔案管理系統,簡稱檔案系統。檔案系統由三部分組成 檔案系統的介面,對物件操作和管理的軟體集合,物件及屬性。...

控制對檔案的訪問

kiosk foundation0 desktop getfacl file file file 檔名稱 owner kiosk 檔案所有人 group kiosk 檔案所有組 user rw 使用者許可權 user kiosk rwx 特殊指派使用者及許可權 group rw 組許可權 mask ...