Linux 普通用户 chown(仅更改组)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16742565/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 23:02:21  来源:igfitidea点击:

Regular user chown (only change group)

linuxpermissions

提问by GCon

While I have seen this question asked multiple times and in a variety of ways, I still haven't found a satisfactory answer.

虽然我已经看到这个问题以各种方式被问了很多次,但我仍然没有找到满意的答案。

Due to security issues, I understand that chown can only be run by a superuser.

由于安全问题,我知道 chown 只能由超级用户运行。

Can a regular user change just the groupof a folder or file of which he is the owner?

普通用户可以只更改他是所有者的文件夹或文件的吗?

I have the following issue: While administrating a server, a student (who I would prefer not to add to the sudoers) configures folders and adds content for a web server. If a folder is created in his home folder, how could he change the group, not the owner? If he could add the wwwgroup to his folder, then he would be free to configure nginx and other parameters.

我有以下问题:在管理服务器时,学生(我不想将其添加到 sudoers)配置文件夹并为 Web 服务器添加内容。如果在他的主文件夹中创建了一个文件夹,他如何更改而不是所有者?如果他可以将www组添加到他的文件夹中,那么他就可以自由配置nginx和其他参数。

采纳答案by unxnut

Check out chgrpcommand. It can be used by the file owner to change the group ownership.

检查chgrp命令。文件所有者可以使用它来更改组所有权。