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.
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.
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.
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.
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.
Check out chgrp
command. It can be used by the file owner to change the group ownership.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With