linux - 即使授予读取权限也无法访问目录

标签 linux

对于我已授予以下权限的目录(读取)

-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/

相关文章:

linux - 在 FOR 循环中查找时如何从名称中删除扩展名

python - 我可以使用 linux perf 获得 python 调用堆栈吗?

java native loadlibrary 无法加载库 - Linux fedora25 java8

Linux SED - 保留空间 - 所有行的一个值

linux - 在Linux终端上安装程序

c++ - "New"运算符的不同行为 - 动态内存分配

Linux 无法识别 perl shebang

python 守护进程被杀死(被内核?)

linux - 使用搜索和替换清理感染 c3284d 病毒的服务器

linux - shell脚本停止错误