Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

what is the best way to fix Ubuntu's Root file system permissions?

I was changing file permissions on a whole bunch of files that needed to be removed, I had accidentally changed the permissions for /, /etc, /var, /home, /bin, /media and all the files underneath. majority of them were changed to 0777. All this because I added a space to chmod command that i was running.

now i am running into issues with stuff not working correctly and unable to log into root with either su or sudo. so administration from the desktop is not possible, and trying to get into grubs OS selection is also impossible because last upgrade for some reason turned it off the menu when it boots. any Kind of Admin action is nearly impossible to do because of this.

Is there a script i can run in the root shell that will fix it or should i just re-install ubuntu? Are there any other things that i can do to fix this other then changing each directory and file to the correct permissions?

I am currently running Ubuntu 10.10 64bit

share|improve this question
    
reinstalling Ubuntu is safer and likely to be less time consuming –  Takkat Feb 10 '11 at 9:10
1  
@Takkat Yes it would be easier to just reinstall, but i do have a lot of things to back up, including config files, so i want to try and get things working and use that as my last option –  jsolarski Feb 10 '11 at 9:47

1 Answer 1

up vote 3 down vote accepted

here is a basic idea I hope you are looking for. I think most file system have permission of 755 for folders and 644 for files except for /bin which has executable files with root as owner.

share|improve this answer
    
Looks like it should work, i will try in the morning when i get access to my machine, Thanks @sagarchalise –  jsolarski Feb 10 '11 at 8:08
    
It worked, now the fun part of reinstalling every thing to fix the files I missed. –  jsolarski Feb 10 '11 at 15:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.