Maintaining Ownership When Copying Files and Directories

Sean McGlynn sean_mcglynn at yahoo.com
Wed Apr 4 12:13:43 UTC 2007


Nigel,

Thank you for your response.  I tried the no_root_squash, which certainly made sense, but to no avail.  I'm going to try some of the other methods suggested, but I'm still wondering if there is something else along these lines.

Thank you again.

----- Original Message ----
From: Nigel Wade <nmw at ion.le.ac.uk>
To: General Red Hat Linux discussion list <redhat-list at redhat.com>
Sent: Tuesday, April 3, 2007 10:48:08 AM
Subject: Re: Maintaining Ownership When Copying Files and Directories

You probably need to set the no_root_squash on the export.

By default root permission is not maintained across NFS mounts. This is 
to prevent an administrator on the NFS client reading files to which 
they should not have access, writing where they should not be able to 
and, worst of all, planting suid root executables to run on the server.

However, if you administer both client and server you can override this 
and give yourself root access to the server's files on the client using 
the no_root_squash in the export options.

Be very careful unless you are the only person with root access to all 
the NFS hosts.

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw at ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555


Sean McGlynn wrote:
> Hello,
> 
> On a RHEL4 server I have mounted a directory from another RHEL4
> server.  I want to copy the files from the mounted directory,
> maintaining ownership and permissions.  When I attempt to do a copy
> as root I get a permission denied message.  When I do a cp -r
> --preserve=all as a user who is a member of a group who has rights to
> the directory I am able to do the copy, the permissions are
> maintained, but the ownership is not.  This makes sense as the man
> page for cp say you need to be root to change ownership.  So how can
> I make this happen if I can't do it as root?  The group is maintained
> in eDirectory, so I can't add root to the group.
> 
> Thank you.
> 
>


 
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news


More information about the redhat-list mailing list