1826797 Members
3110 Online
109703 Solutions
New Discussion

Fixing permissions

 
SOLVED
Go to solution
rmueller58
Valued Contributor

Fixing permissions

We had a person that had root access do a
chown -R bogus:bogus * from the Root directory on our N-Class server..

What a night.

We restored from tape however directories and many files still show incorrect permissions.. Does anyone here have any pearls of wisdom short of handing out resumes that might aid us in the recover process?

Constructive input is great appreciated..
15 REPLIES 15
Christopher McCray_1
Honored Contributor

Re: Fixing permissions

Probably the quickest way (about 2 hours), would be to insert your handy dandy ignite tape, assuming you have one that is current enough (restor frome tape afterward if not). It is you system image, so everything will be restored as it was.

Good luck
Chris
It wasn't me!!!!
A. Clay Stephenson
Acclaimed Contributor

Re: Fixing permissions

The most critical files are going to be those in vg00 where it is essential that owner/group/setuid/setgid settings are correct. If you have a recent make_tape_recovery image, that would be your least evil and most reliable option. The stuff in the other VG's is generally much easier to reset manually.

Plan B: If you have a similar known good system, you could do a find scan on the filesystems and create a file listing filename, owner, group, and permissions and use that to feed a script on your bad system.
If it ain't broke, I can fix that.
James Beamish-White
Trusted Contributor

Re: Fixing permissions

You restored from tape and yet had wrong permissions? Are you sure your restore worked correctly? It hsould restore appropriate permissions.

Otherwise, you'll have to find a working system, do something like:

find / -exec ls -ld {} \; | awk '{print $1,$9}' > permissionslist.txt

to get all the file permissions, then write a script to parse this file on the broke machine and set permissions accordingly. Something using cut -c...

A very slow way, but it should work...

Cheers,
James
GARDENOFEDEN> create light
harry d brown jr
Honored Contributor

Re: Fixing permissions

Rex,

What kind of backup did you restore from? Some backup's allow you to overwrite the existing ownerships with what is on tape. Another way is to create an INDEX of what is on tape and what the ownerships WERE, then write a script to "restore" those ownerships. Of course you did give that person that changed them a good caning?

live free or die
harry
Live Free or Die
John Palmer
Honored Contributor
Solution

Re: Fixing permissions

Have you seen this previous answer for restoring system file permissions:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xa7ef6c96588ad4118fef0090279cd0f9,00.html

Regards,
John
James R. Ferguson
Acclaimed Contributor

Re: Fixing permissions

Hi:

Andreas Voss once wrote a script to fix this very kind of problem:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xa7ef6c96588ad4118fef0090279cd0f9,00.html

Otherwise, if you are on 11.x, have a look at the 'check_patches' utility (see the man pages).

Regards!

...JRF...
rmueller58
Valued Contributor

Re: Fixing permissions

We restored using an frecover tape.

We are able to get in a do things now but many subsystems ie printing etc, are still not working..


Carlos Fernandez Riera
Honored Contributor

Re: Fixing permissions

harry d brown jr
Honored Contributor
rmueller58
Valued Contributor

Re: Fixing permissions

so the check_patches utility should be able to find the correct ones they what would be the best method to fix them?

Carlos Fernandez Riera
Honored Contributor

Re: Fixing permissions

At least all for all system files patches/executables.


For users files you must write a script that read you backup tape ( only listing), and run chown for each file....

If you use tar:

tar tvf /dev/rmt/xxx > /tmp/list.1
and then awk'd list.1

unsupported
James Beamish-White
Trusted Contributor

Re: Fixing permissions

Just a note, I think you should assign some points to the help you have been given above. You don't seem good at doing so.

Cheers,
James
GARDENOFEDEN> create light
rmueller58
Valued Contributor

Re: Fixing permissions

another problem,

is there a quick fix to reactivate accounts globally?
James R. Ferguson
Acclaimed Contributor

Re: Fixing permissions

Hi Rex:

You need to open a new thread for a new question.

Also, you need to score ALL responses with something, even if that's an "N/A", although based on virtually every response thus far in this thread you have received a great out-pouring of help.

...JRF...
rmueller58
Valued Contributor

Re: Fixing permissions

Closing old items - sorry for the delay.