From: Clifton, Pablo (Pablo.Clifton@BCBSFL.COM)
Date: Thu Jan 09 2003 - 10:19:44 EST
Check this out-
it uses a mksysb tape of the damaged system to generate a script to fix
perms-
http://www.gruftie.net/ibm/tl/techlib/qna/faxes/html/cmd/cmd31.htm
<http://www.gruftie.net/ibm/tl/techlib/qna/faxes/html/cmd/cmd31.htm>
if you don't have a mksysb tape, you can use the following:
You run the script listed below on A GOOD system with correct
permissions. This will generate a file 'reset.perms.out' which
contains the necessary 'chmod' and 'chown' commands to restore
permissions on the affected system. You can then COPY this file
over to the BAD system and run it.
-- begin script --
#!/bin/ksh
cd /tmp
rm reset.perms.out 2>/dev/null
find / -ls |awk '{print $3,$4,$5,$6,$7,$8,$9,$10,$11,$12}'|
awk '{
if ( NF == "9" )
{
printf ("chown %s.%s %s\n",$3,$4,$9)
{
perms=0
if(substr($1,2,1) == "r")
perms = perms + 400
if(substr($1,3,1) == "w")
perms = perms + 200
if(substr($1,4,1) == "x")
perms = perms + 100
if(substr($1,4,1) == "S")
perms = perms + 4000
if(substr($1,4,1) == "s")
perms = perms + 4100
if(substr($1,5,1) == "r")
perms = perms + 40
if(substr($1,6,1) == "w")
perms = perms + 20
if(substr($1,7,1) == "x")
perms = perms + 10
if(substr($1,7,1) == "S")
perms = perms + 2000
if(substr($1,7,1) == "s")
perms = perms + 2010
if(substr($1,8,1) == "r")
perms = perms + 4
if(substr($1,9,1) == "w")
perms = perms + 2
if(substr($1,10,1) == "x")
perms = perms + 1
if(substr($1,10,1) == "T")
perms = perms + 1000
if(substr($1,10,1) == "t")
perms = perms + 1001
printf("chmod %d %s # %s\n",perms,$9,$1)
}
}
}' >reset.perms.out
chmod 755 reset.perms.out
-pablo
-- Pablo Clifton UNIX Tech Services * pablo.clifton@bcbsfl.com * DCC603-F212 * 904.905.7116/ 210.287.4021 cell -----Original Message----- From: Shekhar Dhotre [mailto:Shekhar.Dhotre@LENDLEASEREI.COM] Sent: Thursday, January 09, 2003 9:47 AM To: aix-l@Princeton.EDU Subject: permission's or / (root) changed Hi all, Our Junior-while working with Developer changed some permission on root file system, I don't have details but he was telling me developer provided some script to change permission's and he accidentally executed on root file system. Now we are getting messages processes spawning to rapidly ... the box is down. I started working with him to restore this box. What are our options? I know I can restore from mksysb. (He is in doubt about mksysb tape - created one year ago :-) and searching one . Assuming that we don't get mksysb - Can I install AIX from CD and do importvg on whatever volume groups were there? Or is there any way to set / permission's to original one? Thank You SD Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:27 EDT