我想在我所属的staff组所拥有的目录中创建一个文件。为什么我不能这样做呢?
bmccann@bmccann-htpc:~$ ls -l /usr/local/lib/R/
total 4
drwxrwsr-x 2 root staff 4096 2010-07-31 16:21 site-library
bmccann@bmccann-htpc:~$ id -nG bmccann
bmccann adm dialout cdrom plugdev staff lpadmin admin sambashare
bmccann@bmccann-htpc:~$ touch /usr/local/lib/R/site-library/tmp
touch: cannot touch `/usr/local/lib/R/site-library/tmp': Permission denied发布于 2011-02-20 10:49:07
您是否在更改组后注销并重新登录?请参见:
发布于 2015-09-04 20:18:58
我遇到了同样的问题,检查文件夹是否有更多的ACL规则!
如果您在列出文件夹时看到+(加号),这意味着它有特殊的访问规则。例如:
[user_in_apache_group@web02 html]$ ls -l
total 16
drwxrwxr-x 16 apache apache 4096 Sep 4 13:46 ilias
drwxrwxr-x+ 15 apache apache 4096 Sep 4 13:46 ilias5查看权限:
[user_in_apache_group@web02 html] getfacl ilias5
# file: ilias5
# owner: apache
# group: apache
user::rwx
user:user_in_apache_group:r-x
group::rwx
mask::rwx
other::r-x这意味着我的用户(user_in_apache_group)对该文件夹没有写权限。
解决方案是@techtonik所说的,为用户添加写权限:
[user_in_apache_group@web02 html]$ sudo setfacl -m u:user_in_apache_group:rwx ./ilias5再次检查权限:
[user_in_apache_group@web02 html] getfacl ilias5
...
user:user_in_apache_group:rwx
...希望能有所帮助。;)
发布于 2013-11-19 06:57:40
为什么Linux用户不能编辑他所属的组中的文件?
我使用的是Ubuntu 12.04,并且遇到了同样的问题,用户不能写入他被允许组访问的文件。例如:
whoami //I am user el
el
touch /foobar/test_file //make a new file
sudo chown root:www-data /foobar/test_file //User=root group=www-data
sudo chmod 474 /foobar/test_file //owner and others get only read,
//group gets rwx
sudo groupadd www-data //create group called www-data
groups //take a look at the groups and see
www-data //www-data exists.
groups el //see that el is part of www-data
el : www-data 现在重新启动终端,以确保用户和组已经生效。以el身份登录。
vi /foobar/test_file //try to edit the file.生成警告:
Warning: W10: Warning: Changing a readonly file"什么?我做的每件事都是对的,为什么不起作用呢?
答案:
完全重新启动计算机。停止终端还不足以解决这些问题。
我认为发生的情况是apache2也使用www-data组,因此该任务以某种方式阻止了用户和组的正确实施。您不仅必须注销,而且还必须停止并重新启动使用您的组的所有服务。如果重启没有得到它,你就有更大的问题了。
https://stackoverflow.com/questions/5054888
复制相似问题