[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why do UID values of system users matter?



On Sat 17 Aug 2019 at 04:18:00 (+0200), Steffen Dettmer wrote:
> 
> I see, multiboot with different /etc but shared /usr or /local could invite
> a lot of trouble if using different UIDs, indeed! Thanks for the quick
> explanation.

Sure. Most system files can be copied between different /etc
partitions on the same host because they're owned by root.root
or by one of the invariant system users.

But there are a few that can catch you out. For example, it's
obvious that you might want to copy your mail submission passwords
between two systems to save typing them all in again, but
/etc/exim4/passwd.client is owned by root.Debian-exim, and that
GID is >100, so potentially different:

  $ ls -l /agogs/etc/exim4/passwd.client /etc/exim4/passwd.client
  -rw-r----- 1 root mlocate     663 May 30  2018 /agogs/etc/exim4/passwd.client
  -rw-r----- 1 root Debian-exim 663 May 30  2018 /etc/exim4/passwd.client
  $ ls -n /agogs/etc/exim4/passwd.client /etc/exim4/passwd.client
  -rw-r----- 1 0 118 663 May 30  2018 /agogs/etc/exim4/passwd.client
  -rw-r----- 1 0 120 663 May 30  2018 /etc/exim4/passwd.client
  $ 

> > (Apparently man used uid 13 in Debian 8 / Jessi but 6 in Debian 9 /
> > > Stretch).
> >
> > AFAICS, user "man" has had UID 6 since at least Debian 6/squeeze
> >
>  Ohh, this is interesting, so I wonder why I had a different value then,
> maybe something else was wrong with my system then...

Difficult to say. My reaction would be to check the ownership of all
non-root-owned files. Because of the potential for trouble like the
above, I routinely keep a list on each system.

# find / -mount \( ! -group 0 -o ! -user 0 \) -ls | awk '{printf "%s	%s	%s\n", $5, $6, $11}' | sort -k 3 > /root/non-root-owned-files

Cheers,
David.


Reply to: