Hoping someone can help me fix something that I apparently messed up, i have the issue that when I untar a file as root the uid and gid that get set are not roots'. I had change a user uid and gid to 1000 via usermo -u etc.... but somehow it appears to have effected the root user. When I touch files as root the correct uid and gid are root, however when untaring an archive the directory and files are uid and gid =1000. Hope someone can point me in the right direction....oh yea, running centos 5.4, and when I run the command id = uid=0, gid=0, etc,,,,all appear to be right for root....Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20100119/ca43a306/attachment-0001.html>
> Hoping someone can help me fix something that I apparently messed up, i > have the issue that when I untar a file as root the uid and gid that getset> are not roots'. I had change a user uid and gid to 1000 via usermo -u<snip> If I understand you correctly, the user's files were all uid and gid 1000 (please don't tell me that you're letting RedHat's idiocy of creating a new user as a new group of their very own, rather than, say, a member of the group "users"), and you tar'd and then untar'd it, it *should* be the user's, tar is doing what it's supposed to do, and saving permissions and ownership. mark
On Tue, Jan 19, 2010 at 8:43 AM, Tom Bishop <bishoptf at gmail.com> wrote:> Hoping someone can help me fix something that I apparently messed up, i have > the issue that when I untar a file as root the uid and gid that get set are > not roots'.? I had change a user uid and gid to 1000 via usermo -u etc.... > but somehow it appears to have effected the root user.? When I touch files > as root the correct uid and gid are root, however when untaring an archive > the directory and files are uid and gid =1000.? Hope someone can point me in > the right direction....oh yea, running centos 5.4, and when I run the > command id = uid=0, gid=0, etc,,,,all appear to be right for root....Thanks > in advance.When you untar as root, the UID/GID is always set to that of the user who created the tar file. Only if you untar as a normal user does it change the ownership to the user who untarred it.
Tom Bishop wrote on Tue, 19 Jan 2010 07:43:50 -0600:> When I touch files > as root the correct uid and gid are root, however when untaring an archive > the directory and files are uid and gid =1000.Untarring *which* files? The standard behavior of tar is to keep the permissions etc. of the original. So, if they were owned by user x when tarring they will get untarred for user x. If you want to change this have a look at the section " Handling of file attributes:" of "tar --help". Kai -- Get your web at Conactive Internet Services: http://www.conactive.com