5

Why does an owner of a file in Ubuntu need to run sudo in order to execute chown.

Running it without sudo results in an "Operation not permitted" error messge.

2 Answers2

4

You only have to run sudo if you change the owner or the group to a group you don't belong to. You don't need sudo to change the group to a group you already belong to. Note that this is specified in the POSIX standard.

2

File permissions are stored in the parent directory. You have to have w (write) access to the parent directory in order to change permissions, rename or delete files.

ls -ld .  

will show the directory permissions.

waltinator
  • 36,399