TL; DR: Se você deseja executar chmod
em um arquivo no GNU / Linux, você precisa ser root ou o proprietário do arquivo.
Na página de manual chmod (2) (chamada do sistema chmod) :
The effective UID of the calling process must match the owner of the file, or the process must be privileged (Linux: it must have the CAP_FOWNER capability).
Na página de manual recursos (7) :
CAP_FOWNER
- Bypass permission checks on operations that normally require the filesystem UID of the process to match the UID of the file (e.g., chmod(2), utime(2)), excluding those operations covered by CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH; [...]
Na página de manual setfacl (1) :
PERMISSIONS
The file owner and processes capable of CAP_FOWNER are granted the right to modify ACLs of a file. This is analogous to the permissions required for accessing the file mode. (On current Linux systems, root is the only user with the CAP_FOWNER capability.)