对于我已授予以下权限的目录(读取)
-rwxrw-r--. 1 sam sam 117 Feb 6 19:43 test_folder
当我尝试与不属于组 sam 的其他用户访问 test_folder 时。它给出的错误
-bash: cd: test_folder: Permission denied
即使给了其他用户读取权限,仍然出现权限问题
最佳答案
如上所述:为了让其他用户更改目录,他们需要对其具有执行权限。您应该按如下方式更改目录的权限:
chmod 775 test_folder
权限将更改为:
-rwxrwxr-x. 1 sam sam 117 Feb 6 19:43 test_folder
当使用 cd
命令导航到 test_folder
时,其他用户不应再被拒绝权限。
参见this webpage有关文件/目录权限的更详细说明。关于目录,它说:
It is the executable permission on a directory which enables the user to get into the directory.
比较一下:
It is the read permission of the directory which enables the unix user to list the files inside the directory.
一般来说,目录的读取和执行权限通常是一起授予的。
关于linux - 即使授予读取权限也无法访问目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48678922/