Frequently Asked Question
How does chown work and why can only root change ownership?
chown changes the user and/or group that a file belongs to. chown alice file
gives ownership to alice; chown alice:staff file sets both owner and group;
chown :staff file changes only the group; chown -R alice:staff dir/ recurses
into a tree. There is also a sibling tool chgrp that handles the group field on
its own.
Only root can change a file's owner. The reason is historical and quotacentric:
if any user could chown a file away, they could drop big files into a colleague's
account to evade their own disk quota, or hand off a file to escape the audit
trail. An ordinary user can change a file's group, but only if they own the
file and are themselves a member of the target group, so you can move a file
between groups you legitimately belong to but cannot launder it through groups
you have no membership in.