What permissions do I need to set CGI scripts to?

Files and directories within your cgi-bin directory (or CGI scripts elsewhere) should be set to 755, that is:

rwx r-x r-x (chmod 755)

Since the Perl script that will open and write to the file is executed under the owner's userid, and the file is also owned by the same user, then the file only needs to be writable by the owner, not the world. This protects the security of our servers and your website and database(s).

Some Perl scripts which may require you to set a directory to rwxrwxrwx (chmod 777). This is not necessary as 777 is disallowed on our servers - 755 should always be sufficient even if 777 is recommended.

  • 234 Users Found This Useful
Was this answer helpful?

Related Articles

How do I set permissions on files and scripts?

Doing a CHMOD (changing a file's permissions) is the setting of access privileges for a file....

How do I connect to my MySQL database from a Perl CGI script?

Perl's DBI module provides an interface to MySQL databases for CGI scripts. A commented example...

Powered by WHMCompleteSolution