Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-26-2008, 01:05 PM
|
#1
|
|
Member
Registered: Aug 2005
Posts: 75
Rep:
|
unexpected behavior while installing flock
I am using Ubuntu Hardy. I downloaded Flock tar.bz2 as user 'vineet'
I copied it to /opt
after copying and extracting there in opt the owner was changed to another user 'bhoot'.
Whereas where I actually downloaded there it's owner is 'vineet' only.
Why is the owner changed automatically?
Also I am unable to run flock-browser ...
Any help regarding this would be great.
Regards,
Vineet
|
|
|
|
11-26-2008, 01:12 PM
|
#2
|
|
Senior Member
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
|
It could have changed owners due to extraction or just that it inherited the permissions from the /opt filesystem. Just guessing though. Did you give any extra parameters when extracting the file?
|
|
|
|
11-27-2008, 09:18 AM
|
#3
|
|
Member
Registered: Aug 2005
Posts: 75
Original Poster
Rep:
|
something more
Hi,
Today I tried same thing with xmms tar.gz package . After extracting it made some other user '500' as it's owner ... What is this '500' username for ??
Is it an issue with tar command?
Any other ubuntu user please try it out .
Thanks and Regards,
Vineet
|
|
|
|
11-27-2008, 09:23 AM
|
#4
|
|
Member
Registered: Aug 2005
Posts: 75
Original Poster
Rep:
|
I don't have any username as '500' in the /etc/passwd file nor does any user have a userid 500 .
|
|
|
|
11-27-2008, 09:43 AM
|
#5
|
|
Senior Member
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
|
post what you are typing in when untaring the package.
|
|
|
|
11-28-2008, 09:59 AM
|
#6
|
|
Member
Registered: Aug 2005
Posts: 75
Original Poster
Rep:
|
The package names are (in /opt)
flock_afc052961B81660-2.0.en-US.linux-i686.tar (owner root)
and
xmms-1.2.11.tar (owner root)
The command I am giving are
Code:
sudo tar -xvf flock_afc052961B81660-2.0.en-US.linux-i686.tar
and
Code:
sudo tar -xvf xmms-1.2.11.tar
after doing this the output of my ls -l command is as below
Code:
drwxr-xr-x 13 bhoot bhoot 4096 2008-10-07 21:41 flock
drwxrwxrwx 12 500 500 4096 2008-11-27 20:47 xmms-1.2.11
-rwxrwxrwx 1 root root 65 2008-11-26 21:48 connect
-rw------- 1 root root 37099520 2008-11-27 00:01 flock_afc052961B81660-2.0.en-US.linux-i686.tar
-rw-r--r-- 1 root root 15504764 2008-11-27 20:36 skype-debian_2.0.0.72-1_i386.deb
-rw-r--r-- 1 root root 17285120 2008-11-27 20:45 xmms-1.2.11.tar
do let me know if I should provide something more.
Thanks and regards,
Vineet
|
|
|
|
11-28-2008, 11:12 AM
|
#7
|
|
Guru
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,002
|
tar was originally used for making tape archives, for backups.
It bundles up all the files in a directory and saves them in one big file: The tar file.
Along with the files themselves, it also saves data about who the files belonged to, and what group they were assigned to, and a lot of other useful stuff as well (time created, time modified etc.)
[This tar file can also be compressed.]
If you untar a tar file as the user root, then the directories and files will reappear, but with the original owner (UID) and group IDs (GIDs). These are just numbers.
If you untar a tar file as yourself, tar will automatically assign yourself as the owner of the untarred files, and the group assigned to the files will be your default group.
Because you untarred as root the original UID and GID will be assigned to the files.
Linux looks up these numbers in /etc/passwd and /etc/groups and then converts these numbers to username and groupname if it can. If it can't then it'll just show the number instead of a username or groupname.
So.... Someone with a username of bhoot on your machine has the same UID and GID numbers as the user who owned the original flock directory before it was tarred up and you downloaded it.
That's why the user & group are listed as bhoot for the flock directory.
But xmms-1.2.11 was tarred up by someone with a UID of 500 and a GID of 500.
You do not have any users or groups on your machine corresponding to these numbers, so linux cannot look them up, and it just prints the numbers.
Please see man chown for how to change the owner:group of files and man tar for the very many options for the tar command.
Last edited by tredegar; 11-28-2008 at 11:14 AM.
|
|
|
|
11-28-2008, 01:52 PM
|
#8
|
|
Member
Registered: Aug 2005
Posts: 75
Original Poster
Rep:
|
Wow ... very informative stuff... Thanks a Lot
Thanks & Regards,
Vineet
|
|
|
|
11-29-2008, 12:59 AM
|
#9
|
|
Senior Member
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
|
Quote:
Originally Posted by tredegar
tar was originally used for making tape archives, for backups.
It bundles up all the files in a directory and saves them in one big file: The tar file.
Along with the files themselves, it also saves data about who the files belonged to, and what group they were assigned to, and a lot of other useful stuff as well (time created, time modified etc.)
[This tar file can also be compressed.]
If you untar a tar file as the user root, then the directories and files will reappear, but with the original owner (UID) and group IDs (GIDs). These are just numbers.
If you untar a tar file as yourself, tar will automatically assign yourself as the owner of the untarred files, and the group assigned to the files will be your default group.
Because you untarred as root the original UID and GID will be assigned to the files.
Linux looks up these numbers in /etc/passwd and /etc/groups and then converts these numbers to username and groupname if it can. If it can't then it'll just show the number instead of a username or groupname.
So.... Someone with a username of bhoot on your machine has the same UID and GID numbers as the user who owned the original flock directory before it was tarred up and you downloaded it.
That's why the user & group are listed as bhoot for the flock directory.
But xmms-1.2.11 was tarred up by someone with a UID of 500 and a GID of 500.
You do not have any users or groups on your machine corresponding to these numbers, so linux cannot look them up, and it just prints the numbers.
Please see man chown for how to change the owner:group of files and man tar for the very many options for the tar command.
|
Very nice explanation. I always thought it took the permissions straight from the directory.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:46 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|