School of GeoSciences

School of GeoSciences

File Permissions

If you're unfamiliar with Unix file permissions, getting permissions right can be frustrating. Unfortunately, it is necessary to be very picky for security reasons.

For most web pages, the most appropriate thing is to ensure that the files are world-readable, and directories are world-readable and world-executable. Commands that can help you achieve this are:

  • chmod a+rX .... # give everyone read access, and directories eXecute access
  • chmod -R a+rX .... # the same, but Recurse - go down the entire directory tree

For scripts the web server applies a strict set of criteria. If they are not met, the script will not be run. The most likely error is that somebody else can write to either the directory or the file. Commands to resolve that are:

  • chmod go-w .... # remove write permission from group and other
  • chmod -R go-w .... # the same, but Recurse - go down the entire directory tree