I am the owner of the file (userA), and I can't change it to userB.

when I run chown -R userB ./

It tells me : failed to change ownership of
what I am missing?

link|improve this question

67% accept rate
feedback

1 Answer

up vote 3 down vote accepted

You're not allowed to do that, it's just how permissions work. Imagine the implications of being able to chown anything arbitrarily on a system with user disk quotas enforced. It would be trivial to push somebody over their quota.

link|improve this answer
How to resolve it? – Pentium10 May 10 '11 at 6:49
If you are only a user on the box, ask your admin and if you have root rights, use sudo chown. – SvenW May 10 '11 at 6:56
It may be worth talking about why you cannot do it. – Red Tux May 10 '11 at 7:17
The other reason for not being able to do this is easily seen: consider your little binary that adds an extra line to /etc/passwd; you own it, since you compiled it, then you chmod 4755 ./binary ; chown root:root ./binary ; ./binary. Hey presto, no system security. The ability to give a file away by chown is inconsistent with the sudo bit, unless you want no system security at all. – MadHatter May 10 '11 at 7:33
@MadHatter: Great addition, I didn't even think about that. – Tim Bielawa May 15 '11 at 3:27
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

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