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

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: You can change the permissions of the file using chmod if you are the owner of that file without root/sudo permissions but you cannot change the ownership, either user or group (using either chown or chgrp ), of a file even though you are the owner of the file without 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?


if you have access to user B, you could just copy the file while logged in as B. If you also have access to user A, you could then log in and delete the original file. And finally rename the copied file, to the original name (again as B), leaving you with essentially the same file, owned by a different user.

Obviously is not the SAME file, but if you only cared about the contents of the file, this does the trick