[英]Why can't I read a file with permissions applied on it?
在 Unix 系統上,我執行以下操作:
sudo su
mkdir test
touch test/x.txt
chmod -R 700 test
exit
現在,整個test
文件夾僅供root
用戶使用。
現在,我做
sudo su
chmod 777 test/x.txt
exit
然后,在“普通”用戶中,我做
cat test/x.txt
但是我的permission denied
,盡管文件test/x.txt
是對世界開放的。 為什么?
問題是“普通”用戶無法進入test
- 因為缺少x
權限。
因此,與其執行chmod -R 700 test
,不如替換為chmod -R 711 test
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.