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.
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.
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.
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.
w
access. – Ade Malsasa Akbar Oct 25 '18 at 16:27