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?
chmod
does not change owner. It changes permissions.chown
changes owner (and group if need be) andchgrp
changes group.You can use
to set user and group ownership where
-R
does everything that is insidedirectory
. Sosudo chown -R rinzwind:rinzwind /tmp/
would set/tmp/
and everything in it to user rinzwind and group rinzwind.There is also
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}
.In addition to Rinzwind's answer, you might also use
chown :group [file|directory]
to change the group only and leave the owner intact.To change group to current user, use this: