Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
2  
You could put incriminating data in a file and change its ownership to frame someone :) I guess that's one argument against allowing what you suggest. –  roadmr Jan 16 '12 at 16:40
    
Small addition: AFAIU you can change the owning group of a file that you own, provided that you're a member of the group you're changing to. –  Matthijs Kooijman Jun 20 at 13:29
add comment

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.