设置chmod时拒绝权限

孙子

这是我的问题:

我已经建立了一个小组 allowed

我已将其设置为主要组,user1因此在键入后,groups我会allowed在列表中看到第一个。

我通过sudo mkdir dir1<-创建目录,目录root作为所有者和root组(在里面ls -l)创建

我已输入sudo chgrp allowed dir1更改dir1的组

dir1中的所有文件已被更改 chmod 770 *

但我仍然无权访问这些文件-> ls: cannot open directory .: Permission denied

有什么我忘记的吗?如何获得allowed群组用户的访问权限
当然chmod 777是不考虑了...

根据@Elder Geek进行编辑

在dir1内部

>ls -al gives:
>"ls: cannot open directory .: Permission denied"


> sudo ls -al gives: 
> d-wx-wx---  2 root allowed   4096 mar  1 23:30 .
> drwxr-xr-x 24 root root      4096 mar  1 23:29 ..
> -rwxrwx---  1 root allowed    123 mar  1 23:30 excluded
> -rwxrwx---  1 root allowed  15964 mar  1 23:30 found inv.log
> -rwxrwx---  1 root allowed    220 mar  1 23:30 old.log

从1级以上:

> ls -al di* (there is only 1 result for di*  -> dir1)
> ls: cannot open directory dir1: Permission denied
muru
d-wx-wx---  2 root allowed   4096 mar  1 23:30 .

该目录没有任何人的读取权限(这就是为什么只有root可以列出内容的原因)。授予读取权限:

sudo chmod ug+r dir1

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章