Is it possible to change ownership of a file without root access?

If a User A owns file.txt, can User A change the ownership of the file to User B without root access? When i run a chown B file.txt as user A, I get a Operation not permitted error. It seems to me that since User A owns the file, they ought to be able to change the ownership, but I don't see a way to do it. Thanks for the help!


If the User A owns file.txt, he cannot change the ownership of the file.txt without root access/sudo permission. This is a feature and not a bug. And one of the many reasons why the elders chose to put this feature in, has been explained in a comment to your question by roadmr

Bottom-line: Without root/sudo permissions you can change the permissions of the file using chmod, and the group ownership (to any group which you are a member of, with chgrp), if you are the owner of that file, but you cannot change the user ownership (using chown), even though you are the owner of the file, without having root/sudo permissions. This is a feature and not a bug.


No, you cannot change the owner a file without access, but if you own the file, you can change the permissions of the file with chmod and may change the group with chgrp to another group you a member of.

Related Question: chown is allowed to non root user?