Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular user chown (only change group) [closed]

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.

Can a regular user change just the group of 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 www group to his folder, then he would be free to configure nginx and other parameters.

like image 375
GCon Avatar asked May 24 '13 19:05

GCon


People also ask

How do you chown a group only?

Check out chgrp command. It can be used by the file owner to change the group ownership. No, this command only changes the group. chmod will change the owner and can be used to change both the owner and group.

Does chown change group?

The chown command changes the owner of a file, and the chgrp command changes the group. On Linux, only root can use chown for changing ownership of a file, but any user can change the group to another group he belongs to. The plus sign means “add a permission,” and the x indicates which permission to add.

How do you force change ownership in Linux?

Using chown command to forcefully change the owner/group of symbolic file. Using flag '-h', you can forcefully change the owner or group of a symbolic link as shown below.

What does chown user :$ user do?

chown (Gnu) changes the user and/or group ownership of each given file, according to its first nonoption argument, which is interpreted as follows. If only a user name (or numeric user ID) is given, that user is made the owner of each given file, and the files' group is not changed.


1 Answers

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

like image 64
unxnut Avatar answered Nov 01 '22 21:11

unxnut