Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chmoded / with 755. Need help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
Johnyp
Guru
Guru


Joined: 23 Mar 2005
Posts: 301

PostPosted: Thu Jul 16, 2009 2:04 am    Post subject: Chmoded / with 755. Need help Reply with quote

Hi all,
While working as SU I've chmoded my / (root) with 755 by mistake (yea, stupid me). I've stopped the processes when i saw too many lines go by but at that point it was down to the /proc.

Is there a way to tell the system to fix the permissions? What can i do to make my system safe and "right" again?

Thank you
_________________
Gentoo Unanswered Questions- Give it a try!
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Thu Jul 16, 2009 6:07 am    Post subject: Reply with quote

Restore from a backup. You've got one, right? ;]
Back to top
View user's profile Send private message
Johnyp
Guru
Guru


Joined: 23 Mar 2005
Posts: 301

PostPosted: Thu Jul 16, 2009 6:15 am    Post subject: Reply with quote

Yes, but it is old.

Is there any way to have the system check it's own permissions and then set them the way they should be (like during the install?).

I'm running PHP+MySQL+Apache site on this machine. In the worst case i can rebuild it, but i would REALLY rather fix the problem.

Any ideas? Is there a script that could get file permissions from a similarly build machine and then set them for all the files present in both? That would fix almost all permissions and the rest i can do by hand.
Thanks all
_________________
Gentoo Unanswered Questions- Give it a try!
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Thu Jul 16, 2009 12:59 pm    Post subject: Reply with quote

Code:
find * / -printf "%m %p\n" > filename
Will give you the xxx octal permisions in the first column and then the full name with path after a space. One file per line. So it should be something like:
Code:
for i in `cat filename`; do chmod ${i}; done
Although I'm not exactly sober right know - better wait for someone else to check that...
Back to top
View user's profile Send private message
Johnyp
Guru
Guru


Joined: 23 Mar 2005
Posts: 301

PostPosted: Thu Jul 16, 2009 2:42 pm    Post subject: Reply with quote

Anyone people?
_________________
Gentoo Unanswered Questions- Give it a try!
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Thu Jul 16, 2009 3:00 pm    Post subject: Reply with quote

Moved from Other Things Gentoo to Duplicate Threads.

Please search before posting. See Accidentally chmod'd everything 777.
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum