Operating System - HP-UX
1833420 Members
3183 Online
110052 Solutions
New Discussion

owner permissions on /usr

 
SOLVED
Go to solution
Ron Bromwell
Frequent Advisor

owner permissions on /usr

I accidentally executed a chown -R root /usr on my system. After doing this, I can not login to the machine from my Xterminals. I get a error on the password I put in for the account. I have spent the better part of two days comparing the files /usr from a different machine to the machine I messed up, but still haven't been able to fix this issue. Can anyone help me with this? I.E. what file do I need to look at to fix this?
Thanks,
Ron
life's a journey, not a destination
6 REPLIES 6
Patrick Wallek
Honored Contributor
Solution

Re: owner permissions on /usr

2 things to check:

1) The owner of /usr and /usr/bin directories should be bin.

2) Run 'swverify \*' and see what it comes back with. I think it should tell you what ownerships are messed up.
Ron Bromwell
Frequent Advisor

Re: owner permissions on /usr

both directories are owned by bin. Will run swverify \* and let you know what I get.

Thanks,
Ron
life's a journey, not a destination
Marvin Strong
Honored Contributor

Re: owner permissions on /usr

if you can remsh to your host. a quick script should be able to fix it for you.

from good host:

for file in `find /usr -name '*'`
do
OWN=`ll ${a} | awk '{print $3":"$4}'`
remsh badhost "chown ${OWN} ${file}"
done

thats not 100% tested but something similar should work.


Marvin Strong
Honored Contributor

Re: owner permissions on /usr

oops mistake in the above

for file in `find /usr -name '*'`
do
OWN=`ll ${file} | awk '{print $3":"$4}'`
remsh badhost "chown ${OWN} ${file}"
done

make sure you test this before you do it though. Im not sure if the above script is 100% bug free.
Bill Hassell
Honored Contributor

Re: owner permissions on /usr

chown (and chmod) -R are the second most dangerous commands in Unix (the first is rm -rf *). You'll have to fix virtually every file. And of course, check permissions too in case someone previously did a chmod -R. With all the time you've spent, restoring from your make_tape_recovery backup would be a lot simpler.

swverify is a great choice but it (and many of it's spporting tools) reside in /usr...


Bill Hassell, sysadmin
Ron Bromwell
Frequent Advisor

Re: owner permissions on /usr

Thanks all,
I am able to login back in from a Xterminl. I will restore the directory from tape the next time I am able to bring the machine down. Pat thanks for the swverify command.

Ron
life's a journey, not a destination