Well, most of the directories and files have 755 as the default so I would start there to allow you to execute common utilities. You can then later figure out if you want to tighten security.
sudo chmod -R 755 /usr
This page has a variety of ideas, depending on what you have access to. Example, if you have execute permissions on cp
, mv
and cat
you could use the following sequence of commands to "copy" permissions from another file (in this example /bin/ls
).
/bin/cp /bin/ls /tmp/chmod
/bin/cat /bin/chmod > /tmp/chmod
/bin/mv /tmp/chmod /bin/chmod
Notes: The first commands copies a file (including permissions). The second command copies the contents of chmod to the new file (does not overwrite permissions). The last command overwrites the original chmod file.
chmod
is in/bin/
?