问题描述
我跟着这个link改变组/用户的权限,以我自己添加到www数据组
但我仍然无法在/ var / WWW编辑的内容,特别是与上传的内容。
这是我的开发环境,我不想去和chmod发生上载的/ var / WWW /每次。
在保持在/ var / WWW有什么改变的/ var / www目录权限,可以直接从编辑内容和步骤,内容的IDE
我的登录帐户的用户和组名 debianaut
:
组www数据
WWW的数据:WWW的数据debianaut 组debianaut
debianaut:debianaut www数据
我登录作出上述改变后,输入/输出。这似乎直线前进,如果我cretain组用户,我应该得到其所持有的任何权限。
请帮忙解决这个问题。
我怀疑你的问题是,用户帐户有多个组,默认组是不是一个具有写权限的文件夹中。事实上
虽然Linux允许多个组的用户访问,但它不提供访问所有这些一次。下面是解决这一一些选项:
- 更改使用的组中的shell中运行,而
- 更改用户的默认登录组
- 使用访问控制列表
新集团在壳牌
为了启动后壳为不同的用户操作,使用 newgrp
。
更改默认组
为了改变用户的默认组,编辑 / etc / passwd文件
,或者使用命令来完成这项工作(不知道哪个命令,它可能不同于分布分布)。
的ACL
您将有可能preFER使用的ACL。请参阅 setfacl的
的手册页和 getfacl的说明书
。 ACL(访问控制列表)扩大权限。不是所有的Linux系统支持他们,但如果你的Debian系统不我会感到惊讶。以下要加读 - 写 - 执行用户debianaut允许所有的 /无功/网络
:
setfacl的-R -m U:debianaut:RWX在/ var / WWW
顺便说一句 - 你可以查看正在运行的进程的组ID(如您的IDE),使用 PS -o GID -p< PID>
继承的ACL
继后的导致答案继承的ACL。
答案被称为默认
手册页的ACL。下面将设置denianaut ACL中作为默认在/ var / WWW创建的文件:
setfacl的-R -d -m U:debianaut:RWX在/ var / WWW
I followed this link to change group/user permission to add my self to www-data groupbut I am still unable to edit contents in /var/www , specially with uploaded content.
This is my development environments , I dont want to go to chmod /var/www/ each time there is an upload.
While keeping contents under /var/www what are the steps to change /var/www directory permissions to able to edit contents directly from and an IDE
My login account user and group name is debianaut
:
groups www-data
www-data : www-data debianaut
groups debianaut
debianaut : debianaut www-data
I login/out after making these changes. It seems straight forward that if I am user of cretain group I should get whatever permissions they hold .
please help resolve this issue
I suspect your issue is the fact that the user account has more than one group, and the default group is not the one with write permission to that folder.
While Linux allows your user access to multiple groups, it does not provide access to all of them at once. Here are some options to address this:
- Change the group used while running in a shell
- Change the user's default logon group
- Use ACLs
New Group in a Shell
In order to operate as a different user after starting a shell, use newgrp
.
Change default Group
In order to change the user's default group, edit /etc/passwd
, or use a command to do the job (not sure which command, and it probably differs from distribution to distribution).
ACLs
You will likely prefer to use ACLs. See the man pages for setfacl
and getfacl
. ACLs (access control lists) are expanded permissions. Not all Linux systems support them, but I would be surprised if your Debian system doesn't. The following should add read-write-execute permission for user debianaut to all of /var/www
:
setfacl -R -m u:debianaut:rwx /var/www
By the way - you can check the group id of a running process (such as your IDE), use ps -o gid -p <pid>
.
Inheriting ACLs
Following the post here lead to the answer for inheriting ACLs.
The answer is called default
ACLs in the man page. The following will set the ACL for denianaut as the default for files created in /var/www:
setfacl -R -d -m u:debianaut:rwx /var/www
这篇关于如何为/ var / WWW内容编辑由IDE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!