[NTLUG:Discuss] Restore owners

Robert Citek robert.citek at gmail.com
Sat Mar 8 00:26:15 CST 2008


On Fri, Mar 7, 2008 at 9:42 AM, Greg Edwards <gedwards at netbsa.org> wrote:
> If anyone has root access and a RHEL 5.0 or 5.1 install and can send me an
> ls -lAR | grep -v "root root" listing from /usr/lib I'd be grateful.

Another solution might be to install RHEL5 on a spare box or in a VM.
Then run this script as root to get the permissions:

$ find /usr/lib ! -uid 0 -a ! -gid 0 | xargs stat -c "%n %u %g" > owners.txt

Copy the owners.txt file to the old box and run this script:

$ cat owners.txt| while read name uid gid ; do
  chown ${uid}:${gid} $name
done

Good luck and let us know how things go.

Regards,
- Robert



More information about the Discuss mailing list