Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 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.

share|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. –  Sven 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

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.