Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I copied many files to my new linux host. I see that all files have the owner and group both set to 515. What does that mean?

share|improve this question
    
Clarification: this was the uid/gid of the files on the original host. it's a good idea to recreate users with the same uid/gids when you migrate to a new server. –  laher May 13 '11 at 11:48
add comment

migrated from stackoverflow.com May 13 '11 at 13:39

This question came from our site for professional and enthusiast programmers.

6 Answers

up vote 14 down vote accepted

You probably did a copy that preserved the original group and owner of these files. Within linux internally the owner and group is basically just an id (in your case, the number 515). This id is then mapped on a group and user name listed in /etc/passwd or /etc/group. You will see that in those files, you can find the name of the user and also the id used for that specific user and group.

Most likely in the /etc/group and /etc/passwd, the id "515" is not listed, and for this reason the id itself is shown.

You can change the ower and group to an existing owner and group with the commands chown and chgrp respectively.

share|improve this answer
    
Side note: Most common scenario for orphan user/groups is extraction from an archive. –  Mel May 13 '11 at 14:35
add comment

It means that:

  1. The file is owned by user:group 515:515
  2. the user and group ids 515 are not defined in /etc/passwd or /etc/group as assigned to a specific user and group.
share|improve this answer
add comment

It means that either there is no user and group with those IDs, or that their names are too long to display entirely in that field.

share|improve this answer
add comment

It means, that the group has been named "515" and the user has been named "515" ?

share|improve this answer
    
i dont have any user like that , is it random , how did the system pick that number –  Mirror51 May 13 '11 at 11:34
    
Hmm, I see. I don't know then, see the other answers, sry –  Kiril Kirov May 13 '11 at 11:43
    
Every username has a numeric ID associated with it. On most linux distributions, the automatically assigned ones for normal users count up from 500 or 1000. –  Random832 May 13 '11 at 18:55
add comment

It is the user or group id of users.

The mapping to user names is in /etc/passwd (for user ids) or /etc/groups (for group ids)

See

man id
man usermod  # (the -u option)
man groupmod # (the -g option)
man shadow   # (to know why you shouldn't meddle with /etc/passwd directly)
share|improve this answer
add comment

The numbers can be three digits or four digits. Four digits have a more special purpose and if you are curious, read the chmod documentation.

The first digit is the user, the second digit is the group, and the third digit is all others. That is going from left to right, in case there are any confusions there. So in actuality, when you do an ls -l you'll see nine spaces (read, write, and execute for user, then group, then others).

For octal notation, remember these three numbers and their purpose:

4 Read 2 Write 1 Execute (search in directory)

like if yoiu want to set the read execute and write permission for the user, write and read for the group and read for user then the notation would be

**u**      **G**      **o**
4+2+1       4+2         4 
  7          6          4

i hope it will clear the concept


in your case 5 1 5 means read and execute permission to the user, execute to the group and read and execute to others.


share|improve this answer
1  
You have completely missed the point of the question. The op is not asking about file permissions (which is what you are addresssing)... rather, the question is about the identifiers assigned to users and groups. –  TheGeeko61 Jan 16 '12 at 2:09
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.