
所以我有兩個組fruits
和vegetables
。mango
是屬於群組的使用者fruits
。insecticide
的主目錄中有一個名為 的資料夾mango
。我想為群組提供vegetables
對該insecticide
資料夾的唯讀存取權限。
以用戶身份登錄mango
,我嘗試運行命令
$ chown mango.vegetable insecticide
chown: changing ownership of 'insecticide': Operation not permitted
編輯: ls -l 輸出:
mango@node1:~$ ls -l
total 8
drwxr-xr-x 2 mango fruit 4096 May 31 13:48 pests
-rw-r--r-- 1 mango fruit 0 May 31 13:47 xyz.txt
drwxr-xr-x 2 mango fruit 4096 May 31 16:00 insecticide
答案1
Mango 作為普通用戶無法將他擁有的物件上的群組設定為他不屬於的群組。
所以他要么需要被添加到群組蔬菜中,要么需要 root 來進行所有權變更。