Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
113
rated 0 times [  113] [ 0]  / answers: 1 / hits: 250001  / 1 Year ago, thu, march 23, 2023, 2:42:29

I am having an access problem to some files and directories that I have tracked down to the group assigned to access them.



When I manually change the name of the group in the properties/permissions menu for a directory from the default setting (MyGroup) to www-data used by my Drupal Website, the directory error messages I get are gone.



There are a large number of files and directories that require this change. If believe using chmod will change the owner which is set correctly and being new to Ubuntu, I am reluctant to experiment without a better understanding of how owner and groups work in the permissions settings.



What command changes the Group setting for a directory?


More From » permissions

 Answers
7

chmod does not change owner. It changes permissions. chown changes owner (and group if need be) and chgrp changes group.



You can use



chown {-R} [user]{:group} [file|directory]


to set user and group ownership where -R does everything that is inside directory.
So sudo chown -R rinzwind:rinzwind /tmp/ would set /tmp/ and everything in it to user rinzwind and group rinzwind.



There is also



chgrp {-R} [group] [file|directory]


if you do not need to touch the user permissions and only need to set the group.



Oh and you can check what group a user belongs to with groups {username}.


[#39154] Friday, March 24, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
barted

Total Points: 424
Total Questions: 103
Total Answers: 101

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
;