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.

I am using ubuntu 10.04,I need to give execute permission in www folder.But by mistake i gave execute permission in whole var folder.

sudo chmod -R 777 /var
Then i try to change it into normal permission.For that i gave
sudo chmod -R 775 /var/
And again i gave execute permission only www folder.But the problem is my index.html file is not run which is located in inside the www folder. How to restore the default permission on the /var directory/folder.

share|improve this question

1 Answer 1

The quick answer is that you're screwed. There is no undo. Be careful what you do with sudo. The quick solution is to reinstall.

But as this is just /var we could perhaps try to fix it. I could for example run this command on my system:

 find /var -exec stat --format "chmod %a %n" {} \; > /tmp/restoreperms.sh

This would give a script that you could run, and would try to reset all permissions as they are on my system. This should fix most issues. But I'm not sure how similar my installation is, as I'm using 12.10.

share|improve this answer

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.