General FAQ #1

What does chmod xxx mean? What is chmod?

Short Answer

chmod is a Unix command that changes file permissions, allowing users and groups to read, write, and/or execute files.

Long Answer

For CGI scripts, the web server's user ID (uid) must have permission to execute Perl scripts and read/write data files. Different chmod values are used for different purposes:

Executable Scripts (755)

Perl scripts in the cgi-bin must be executable by the web server:

chmod 755 filename.pl

This allows everyone to read and execute the file, but only you can write to it.

Writable Files (777)

Files that are automatically updated by scripts must be writable and readable by all:

chmod 777 filename.html
chmod 777 filename.txt

This allows everyone to read and write to your files.

Understanding Permission Numbers
Number Permission Meaning
4ReadCan view file contents
2WriteCan modify file
1ExecuteCan run as program
7rwxRead + Write + Execute (4+2+1)
5r-xRead + Execute (4+1)

The three digits represent: Owner | Group | Others

  • 755 = Owner: rwx, Group: r-x, Others: r-x
  • 777 = Owner: rwx, Group: rwx, Others: rwx
  • 644 = Owner: rw-, Group: r--, Others: r--
More Information

For detailed documentation, type at the Unix prompt:

man chmod
Back to FAQ Next: Platforms