Support - Knowledge base

Giving you the answers you need

Why not try our knowledge base for instant help and advice to enhance your online experience with Register365? From within the knowledge base you can browse our frequently asked questions and find the right answers to help solve your queries.

Home  >  Scripting  >  View Article

What permissions should I use for a script?

3*3*3*3*3*

Article

Some scripts come with instructions suggesting that you should make some files or directories "world-writable" (also known as "mode 666" or "mode 777").

Those instructions are unnecessary. On our servers, nothing should ever need to be world-writable with mode 666 or 777.

Correct permissions on your Linux hosting should be set to:

  • Directories should be mode 755 (rwxr-xr-x)
  • Perl scripts should be mode 755 (rwxr-xr-x)
  • PHP scripts should be mode 644 (rw-r--r--)
  • Files that your scripts write to should be mode 644 (rw-r--r--)

These permissions will work properly for any scripts. Your script will be able to write to these files and directories where necessary, but nobody else will be able to do so.

Note that with the exception of changing Perl scripts to mode 755, these permission settings are usually the defaults when you upload files. In other words, you should not usually need to change the permissions of directories, PHP scripts, or files that your scripts write to.

Rate This Article

How useful was this article?

Not usefulA little usefulUsefulVery usefulEverything I needed