Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 81887  / 2 Years ago, wed, june 1, 2022, 8:31:02

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!


More From » permissions

 Answers
6

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.


[#40913] Thursday, June 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
reangi

Total Points: 213
Total Questions: 102
Total Answers: 114

Location: Namibia
Member since Wed, Jan 19, 2022
2 Years ago
reangi questions
;