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.

We have a NFS server provide home directory for many account, which provided by a NIS server.

I have account A and B. In /home/A, I try to copy "cp -a /home/B/somedir ~/". Then I found in /home/A/somedir, all files are owned by user A.

Then if I do "chown -R B:B somedir", I got "Operation not permitted" error.

I am user A, "cp -a" didn't preserve the original user (B). Then I cannot chown my own files.

Any suggestion?

I fix my own issue by "chmod 777 /home/A", "su - B" and "cp -a somedir /home/A/", and "su - A", then "chmod 755 /home/A". But it is not a good solution.

share|improve this question
2  
valpa, in your 9 months on SF you have asked six questions, all of which have answers, and in no case have you accepted one. Local etiquette is that after a reasonable time, you accept the best answer for any given question, and that helps drive SF's reputation system. You don't have to do this, but as a result we see a big red warning "0% accept rate" by your username. That warning may discourage some people from answering your questions. If you had time to go through your old questions and accept an answer for each by clicking on the "tick" outline by the best, that would be good. –  MadHatter Oct 6 '12 at 13:33
    
As the answer below says, there is no good solution. Perhaps there is a wider problem that lead you to keeping files owned by one user in the directory of another user. Maybe this problem has an entirely different solution that avoids the need to mix ownership. Could you explain, what you are trying to do in a wider context? –  Dmitri Chubarov Oct 6 '12 at 15:51
add comment

1 Answer

What you describe is perfectly normal behaviour of a regular UNIX system.

A regular user can't and should not chown files to other users. Only root may do that.

The Open Group's documentation and Wikipedia claim that there are implementations which allow regular users to 'give away' ownership, but they do not state which systems that would be. I can tell for Linux and Solaris, that chown for regular users doesn't work.

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.