18

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.

1 Answer 1

16

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.)

2
  • Thanks a lot. Permissions back to normal, though it did not seem to apply recursively.ie. to certain files within sub-folders of /opt directory.eg 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, 2012 at 3:25
  • I added mention of chown -R to change ownership recursively.
    – cdaddr
    Apr 28, 2014 at 14:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .