

If Alice gives away a file to Bill, there is no trace that Bill didn't create that file.Then count under Bill's disk quota even though only Alice can use the One else could access that world-writable file in the directory), and then runĬhown to make that file owned by another user Bill. If a system has disk quotas enabled, Alice could create a world-writable file under a directory accessible only by her (so no.

User can allow bad things to happen in uncommon, but still important The reason for this restriction is that giving away a file to another The rationale behind this has been nicely explained by in this Unix & Linux answer: If _POSIX_CHOWN_RESTRICTED is in effect for path:Ĭhanging the user ID is restricted to processes with appropriate privileges.Ĭhanging the group ID is permitted to a process with an effective user ID equal to the user ID of the file, but without appropriate privileges, if and only if owner is equal to the file's user ID or ( uid_t)-1 and group is equal either to the calling process' effective group ID or to one of its supplementary group IDs. In other words, only root can give a file to another user.Īs explained here (thanks processes with an effective user ID equal to the user ID of the file or with appropriate privileges may change the ownership of a file.

To use chown, a user must have the privileges of the target user. Non-privileged users (not root) cannot chown files to other user names.
