Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

During the copying of certain program folders to my /opt directory I mistakenly changed the permissions of the /opt directory.

At the moment I (current user) can simply write/copy files to the /opt folder without appending sudo.

I need instructions to revert it back to the default as I've got some really important programs in that folder and Google Chrome has stopped working since that error occurred.

share|improve this question
up vote 5 down vote accepted

My permissions for /opt are drwxr-xr-x (with ownership root:root). That's the default.

You can set this ownership and permissions (regardless of how it's set currently) with:

sudo chown root:root /opt
sudo chmod 0755 /opt

If you changed the permissions of files and folders inside /opt as well, then a good solution might be more complicated. (You can add the output of ls -lR /opt to your question, to show this.)

share|improve this answer
Thanks a lot. Permissions back to normal, though it did not seem to apply to certain files within sub-folders of /opt i had to reclaim certain google chrome files for root before it began working again, even though i set the topmost /opt directory as belonging to root – xupv5 Jul 29 '12 at 3:25
I added mention of chown -R to change ownership recursively. – cdaddr Apr 28 '14 at 14:19

Your Answer


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.