This is in AIX 5.3..I need to revert back permissions

Mistakebly I have changed the permissions on OS

I was in a folder /obie
ls -al
drwxr-x--x    obie:obi .
drwxr-x--x    obie:obi ..

In a rush I have changed the ownership of ". ."
chown -R root:system ..

This changed the whole OS permeissions to root:system

Please post all the steps as how to revert back changes
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There is no "undo" for chown or chmod. AIX does have some information about the AIX files in the system. You can use it as follows:

lslpp -Lc | grep -v "^#" | cut -d: -f1 | while read FILESET
sysck -iN -f /etc/security/sysck.cfg  "$FILESET"

I'm not sure whether sysck will actually do the trick.

I assume you do have another AIX system at the same or a similar oslevel?

If so, and if sysck doesn't help, you could extract all the permissions from the unmodified system and apply them to the damaged system.

If you consider this an option, log in to the clean, unmodified system as root and run

find / -ls | awk '{print  "chown", $5 ":" $6, $11}' >

Transfer the resulting file "" to the damaged system, store it in a convenient location (maybe /tmp) and run as root

sh /tmp/

There will be most probably lots of error messages complaining about files not found, which you'll have to ignore.
And of course this method can only work for files present on both systems, so you'll have no luck with filesystems (e.g. contained in user volume groups) unique to the damaged system.

Another idea - dou you have an mksysb image of the damaged system, taken before the ownership changes occurred?

If so, you could use the "-Po" (or "-PA") options of "restore", which will bring back the ownership (or all the attributes) of the files, without restoring the file contents.

Maybe you even do have "savevg" images of your non-rootvg volume groups? If so, you can also restore the ownership of files from those VGs.

If this could be an option, please let me know if you need assistance.

What I forgot to say -

the above "chown from clean system" method will not work for all the entries in /dev.

For those entries you must run additionally at the unmodified system

find /dev -ls | awk '{print  "chown", $5 ":" $6, $12}'  >

Transfer the new file to the damaged system and run it there, as described above.

Again, there will be "file not found" or usage errors (lots of). Ignore them!


wmp: I'm not sure whether sysck will actually do the trick.

@wmp: We both agree that there is no *guaranteed" way out of this except full restore from backup. But sysck will get quite a lot back. Test like this:

# cat /tmp/test.sysck
ls -l /usr/bin/getconf
chown root.system /usr/bin/getconf
ls -l /usr/bin/getconf
sysck -Ni -f /etc/security/sysck.cfg 2>/dev/null
ls -l /usr/bin/getconf
# . /tmp/test.sysck
-r-sr-xr-x   1 root     bin           23430 10 Jul 2005  /usr/bin/getconf
-r-sr-xr-x   1 root     system        23430 10 Jul 2005  /usr/bin/getconf
-r-sr-xr-x   1 root     bin           23430 10 Jul 2005  /usr/bin/getconf
Test like this
ls -l /usr/bin/ls
chown root.system /usr/bin/ls
ls -l /usr/bin/ls
sysck -Ni -f /etc/security/sysck.cfg  bos.rte.commands 2>/dev/null
ls -l /usr/bin/ls
-r-xr-xr-x    1 bin      bin           27468 Jun 22 2009  /usr/bin/ls
-r-xr-xr-x    1 root     system        27468 Jun 22 2009  /usr/bin/ls
-r-xr-xr-x    1 root     system        27468 Jun 22 2009  /usr/bin/ls
There are some 2200 entries in sysck.cfg, but only ca. 1000 with owner/group other than "root/system".
Only these are relevant to aixtutorial.
So I should have written "will do the trick only partially".

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.