1. 新建檔案c1.txt屬主是root

chown fgx c1.txt 將c1.txt的屬主改為用戶fgx

chown aaa:aaa c1.txt 將c1.txt的屬主改為aaa,屬組改為aaa

2. 用戶qaz只具有對b1.txt的只讀權限


chmod 646 b1.txt 將b1.txt寫的權限授予其他用戶
(其他用戶的權限從只讀改為了可讀、可寫)

3. chmod u+r b1.txt 授予主用戶對b1.txt的可讀權限

4. chmod u-r b1.txt 把主用戶對b1.txt可讀權限去掉

5. chmod g+x b1.txt 授予組用戶對b1.txt的可執行的權限

6. 把組用戶對b1.txt可讀權限去掉

7. chmod o-r b1.txt 把其他用戶對b1.txt的可讀權限去掉

chmod a=r b1.txt 將全部用戶對b1.txt只授予只讀權限

9. chmod -R 777 aaa
將檔案夾aaa的權限改為可讀、可寫、可執行并繼承給子檔案和子檔案夾

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/9791.html
標籤:Linux
上一篇:Linux用戶和組管理
