(question) What is the purpose of UID==GID?

Just curious... I noticed that distros tend to create user account with unique UID and unique GID (and usually both are the same id). For example, UID=1000 and GID=1000. What is the reason behind it? -- William

On 01/11/2016 03:30 AM, William Park wrote:
Just curious...
I noticed that distros tend to create user account with unique UID and unique GID (and usually both are the same id). For example, UID=1000 and GID=1000.
What is the reason behind it?
As I understand it, it's so you can give some, but not all, other users group access to your stuff. With a common GID, it's everyone or no one.

GID does not have to equal UID. It just does by convention. If you can keep the relationship then it makes admin a slight bit easier. For example if you do an ls and get 4 drwxrwxr-x. 2 108 108 4096 Feb 23 2015 foo.bar you know the owner/group are set to a reasonable value as opposed to 4 drwxr-xr-x. 7 1000 500 4096 Dec 14 2012 bar.baz where you now need to lookup the GID for UID 1000. On 01/11/2016 03:30 AM, William Park wrote:
Just curious...
I noticed that distros tend to create user account with unique UID and unique GID (and usually both are the same id). For example, UID=1000 and GID=1000.
What is the reason behind it?
-- Alvin Starr || voice: (905)513-7688 Netvel Inc. || Cell: (416)806-0133 alvin@netvel.net ||

On Mon, Jan 11, 2016 at 03:30:12AM -0500, William Park wrote:
Just curious...
I noticed that distros tend to create user account with unique UID and unique GID (and usually both are the same id). For example, UID=1000 and GID=1000.
What is the reason behind it?
There isn't one. But most distributions use uid/gid 1000+ as regular users, and if you always create a user and their matching group (as the adduser and such tools do by default), then the assigned numbers will always stay in sync since they are allocated at the same rate. So it is pretty much just a coincidence. -- Len Sorensen
participants (4)
-
Alvin Starr
-
James Knott
-
Lennart Sorensen
-
William Park