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
More on Permissions, Users & sudo
Explain the rwx permission model for files and directories.BeginnerHow does octal notation work in chmod?BeginnerWhat is umask and how is the final permission calculated?IntermediateWhat is SUID and give a real example?IntermediateWhat does SGID do on files versus directories?IntermediateWhat does a capital S or T in `ls -l` output mean?Intermediate