username
即使在取得所有权并授予其所有权限后,我仍无法打开目录:
sudo mkdir /path/to/the/directory/
sudo chown -R username:username /path/to/the/directory/
sudo chmod -R 777 /path/to/the/directory/
我得到:
$sudo ls -al /path/to/the/directory/
total 0
drwxrwxrwx 1 username username 0 nov 16 15:13 .
drwx------ 1 root root 208 nov 16 15:13 ..
$ ls -al /path/to/the/directory/
ls: cannot access '/path/to/the/directory/': Permission denied
会发生什么事?
答案1
您无权访问父目录
drwx------ 1 root root 208 nov 16 15:13 ..
您必须拥有父目录的 x 权限才能通过此目录
drwx--x--x 1 root root 208 nov 16 15:13 ..
要做到这一点 :
sudo chmod go+x /path/to/the