Interview Prep/Linux/Permissions, Users & sudo

What does chown do and who can run it?

IntermediateConceptPermissions, Users & sudo
Answer

chown changes owner and/or group. Only root (or a process with CAP_CHOWN) can give a file away to another user; an owner can change the group only to a group they belong to (chgrp).

sudo chown -R www-data:www-data /var/www/site
sudo chown :devops report.txt
All Linux questions Roadmap: Linux

More on Permissions, Users & sudo