Ubuntu – Default permissions for /opt directory


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.

Best Answer

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