chmod is a Unix command that changes file permissions, allowing users and groups to read, write, and/or execute files.
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:
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.
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.
If you don't have these, contact your system administrator.
| Number | Permission | Meaning |
|---|---|---|
4 | Read | Can view file contents |
2 | Write | Can modify file |
1 | Execute | Can run as program |
7 | rwx | Read + Write + Execute (4+2+1) |
5 | r-x | Read + Execute (4+1) |
The three digits represent: Owner | Group | Others
755 = Owner: rwx, Group: r-x, Others: r-x777 = Owner: rwx, Group: rwx, Others: rwx644 = Owner: rw-, Group: r--, Others: r--For detailed documentation, type at the Unix prompt:
man chmod