Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #212990
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Why do UID values of system users matter? |
| Date | 2019-08-19 19:30 +0200 |
| Message-ID | <ywTDH-83c-3@gated-at.bofh.it> (permalink) |
| References | <yvRXj-mJ-9@gated-at.bofh.it> <yvSTn-YA-3@gated-at.bofh.it> <yvWtY-3jD-3@gated-at.bofh.it> <yvYP7-4G6-1@gated-at.bofh.it> <ywPTs-5hK-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon 19 Aug 2019 at 09:24:59 (-0400), Greg Wooledge wrote:
> On Fri, Aug 16, 2019 at 11:42:12PM -0500, David Wright wrote:
> > 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
>
> The use of $11 here assumes the filename doesn't contain any whitespace.
> It'll break if one does. You'd be better off using GNU find's -printf
> features, than parsing the output of -ls with awk.
Yes, I expect the reason I haven't lost anything in my listing is that
whitespace is sensibly avoided in these system files.
> Looks like you want the username, groupname, and filename. So that would
> be:
>
> find / -mount \( ! group 0 -o ! -user 0 \) -printf '%u %g %p\n' |
> sort -k 3 > /root/non-root-owned-files
Much appreciated improvement. (The - in -group got lost in transcription.)
Using \t tidies up the columniation too:
# find / -mount \( ! -group 0 -o ! -user 0 \) -printf '%u\t%g\t%p\n' | …
Cheers,
David.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Why do UID values of system users matter? Steffen Dettmer <steffen.dettmer@gmail.com> - 2019-08-16 23:30 +0200
Re: Why do UID values of system users matter? Dan Hitt <dan.hitt@gmail.com> - 2019-08-17 00:20 +0200
Re: Why do UID values of system users matter? Pascal Hambourg <pascal@plouf.fr.eu.org> - 2019-08-17 00:30 +0200
Re: Why do UID values of system users matter? Steffen Dettmer <steffen.dettmer@gmail.com> - 2019-08-17 04:20 +0200
Re: Why do UID values of system users matter? Kenneth Parker <sea7kenp@gmail.com> - 2019-08-17 05:10 +0200
Re: Why do UID values of system users matter? Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-19 15:20 +0200
Re: Why do UID values of system users matter? David Wright <deblis@lionunicorn.co.uk> - 2019-08-19 20:00 +0200
Re: Why do UID values of system users matter? David Wright <deblis@lionunicorn.co.uk> - 2019-08-17 06:50 +0200
Re: Why do UID values of system users matter? Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-19 15:30 +0200
Re: Why do UID values of system users matter? David Wright <deblis@lionunicorn.co.uk> - 2019-08-19 19:30 +0200
Re: Why do UID values of system users matter? <tomas@tuxteam.de> - 2019-08-17 10:20 +0200
Re: Why do UID values of system users matter? David Wright <deblis@lionunicorn.co.uk> - 2019-08-17 06:10 +0200
csiph-web