[CentOS] chown command goof up

Mon Feb 12 21:49:45 UTC 2007
MrKiwi <mrkiwi at gmail.com>

Ross S. W. Walker wrote:
>> -----Original Message-----
>> From: centos-bounces at centos.org 
>> [mailto:centos-bounces at centos.org] On Behalf Of David A. Woyciesjes
>> Sent: Monday, February 12, 2007 3:35 PM
>> To: CentOS
>> Subject: [CentOS] chown command goof up
>>
>> 	Basically, what I typed was:
>> chown -R user2:user2 *
>> chown -R user2:user2 .*
>> chown -R user2:user2 *.*
>> ...all in /home. Duh. I forgot which way recursive went.
>> So, I then did:
>> chown -R root:root *
>> chown -R root:root .*
>> chown -R root:root *.*
>> ...this time in / to try and f things. Duh again. Other items need to 
>> have other owners & groups.
>>
>> 	So, how can I fix this? In MacOSX, there is a utility 
>> to fix all 
>> permissions on the system. Is there a similar item in CentOS?
>>
>> 	Here's what I originally wanted to do:
>> Started with user1. Got everything setup just right. Then 
>> created user2. 
>> I wanted to use all the settings, mail, etc. from user1 for user2. My 
>> thought was to just copy everything in /home/user1 to 
>> /home/user2, then 
>> use chown on all of the files. This is where I got myself into this 
>> pickle...
>>
>> 	Any ideas?
> 
> In case nobody just comes out and says it.
> 
> # rpm --setperms `rpm -qa`
> # rpm --setugids `rpm -qa`
> 
> Should fix it.
> 
> -Ross

Wow! Never knew this one.

I have re-read TFM, but there isnt much about the --set* 
options - could this be used daily as a 'tidy up' sort of 
routine? or would it screw with *.conf ?

rkhunter currently looks for sus executable files, this 
could reset perms on everything system related?

This is what i love about the style of packaging with rpm - 
you know what happens in an install (and can repeat it!), 
rather than 'black box' installations with windose where you 
can never be sure what happened or if a 'refresh' will 
rewrite local configs.

Regards,

MrKiwi