1

I'm witnessing a a directory which has for group owner "1002" ... However I do not have any group with such ID (verified with getent group | grep 1002 ).

Even history | grep groupadd gave nothing.

Where could that be coming from. Any '100x' group ID is a user ID if I'm right no ?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Torof
  • 207
  • 3
  • 7

1 Answers1

2

Group IDs and User IDs are independent. The same number may be used for user "foo" and group "bar".

Some Linux distributions by default create a new group "foo" when you create user "foo", both having the same numerical ID. (This kills the very notion of group, IMHO.)

ls by default shows the group name, but the filesystem stores the numerical group ID. If a group is removed, files belonging to it are not, then ls shows the numerical ID.

So the situation you observe may come from, e.g.:

  • creating a user who gets affected number 1002 and implying creation of group 1002, then removing this user (assuming the distribution tools then remove the associated group)
  • syncing a file from another computer where its owning group has number 1002
L. Levrel
  • 1,453
  • 8
  • 23
  • 1
    Don't forget extracting files from an archive with `pax -p e` and the like. There are questions on this site about that very thing. – JdeBP Jan 27 '19 at 13:11
  • amazing, I think that was it !! I created a user whom I then removed ! Thanks – Torof Jan 27 '19 at 13:40