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.
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
<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@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.
So I downloaded the tar file, wget.... running as root (su -). Looking at the file permissions owner and group are root but when I untar the file the new directory and all of the files have the UID and GID set to 1000, which was another user and not the one that I logged in with.....
On Tue, Jan 19, 2010 at 8:44 AM, Brian Mathis brian.mathis@gmail.comwrote:
On Tue, Jan 19, 2010 at 8:43 AM, Tom Bishop bishoptf@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. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
So I downloaded the tar file, wget.... running as root (su -). Looking at the file permissions owner and group are root but when I untar the file the new directory and all of the files have the UID and GID set to 1000, which was another user and not the one that I logged in with.....
Right, that's the uid and gid of whoever tar'd the files up, which clearly seems to be the same, and since you don't have a user with that uid and gid, it just uses the numerical value that it came with.
On Tue, Jan 19, 2010 at 8:44 AM, Brian Mathis brian.mathis@gmail.comwrote:
On Tue, Jan 19, 2010 at 8:43 AM, Tom Bishop bishoptf@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. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Tom Bishop bishoptf@gmail.com schrieb am 19.01.2010 15:53:52:
So I downloaded the tar file, wget.... running as root (su -). Looking at the file permissions owner and group are root but when I untar the file the new directory and all of the files have the UID and GID set to 1000, which was another user and not the one that I logged in with.....
What do you mean by 'looking at the file permissions'? Do you mean the file permissions of the tarball or the files inside the tarball?
Sometimes it can be helpful to provide the actual commands and it's output :-/
What Brian tries to tell you is that if untarring as root the file ownership and modes are preserved as displayed by e.g.:
tar tf archive.tar
HTH, Frank.
Thanks guys, the light bulb finally went off, need more sleep ;).....so here is what I think happened, so I run buntu at home on some PC's and had set the uid to one of my users (my wife) to 1000 for nfs stuff, which is the defaul range for ubuntu uid's. So when I downloaded the file and untar the users must have had a uid of a 1000 which on my system equated to my wifes uid...LOL, was too late and it never crossed my mind so when I saw the owner and group as my wife that it was just a shared uid...8>) Thanks for the tips
On Tue, Jan 19, 2010 at 9:09 AM, Frank.Brodbeck@klingel.de wrote:
Tom Bishop bishoptf@gmail.com schrieb am 19.01.2010 15:53:52:
So I downloaded the tar file, wget.... running as root (su -). Looking at the file permissions owner and group are root but when I untar the file the new directory and all of the files have the UID and GID set to 1000, which was another user and not the one that I logged in with.....
What do you mean by 'looking at the file permissions'? Do you mean the file permissions of the tarball or the files inside the tarball?
Sometimes it can be helpful to provide the actual commands and it's output :-/
What Brian tries to tell you is that if untarring as root the file ownership and modes are preserved as displayed by e.g.:
tar tf archive.tar
HTH, Frank. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
From: Tom Bishop bishoptf@gmail.com
So I downloaded the tar file, wget.... running as root (su -). Looking at the file permissions owner and group are root but when I untar the file the new directory and all of the files have the UID and GID set to 1000, which was another user and not the one that I logged in with.....
Which is the normal behavior... If you tar /etc, you want to preserve file ownership... If you untar etc.tar and all files would become owned by root, it would break many things... If you need, look at -o or --owner tar options (man tar will help)...
JD
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