Tealmermaid Designs

web design, coding, and SEO tips and tricks

Codes for CHMOD

Share:

chmod codes
CHMOD is an abbreviation of change mode. This is a UNIX command to change the permissions on a file. It is based on the Binary language. When viewed on a server, file permissions appear in the form:

aaabbbccc user filename

where a represents the permissions granted to the owner of the file, b represents the permissions granted to the usergroup of the file, and c represents the permissions granted to everyone else.


File permissions

There are four states for each permission:

These file permissions can be changed with CHMOD. This can be done at the command line in the form:

chmod abc filename

Common file permissions:

A typical HTML, PHP, or image file on a server should have its permissions set to 644 (shown on the server as -rw-r--r--. It is rare to need them to have any other permissions -- and if you do see another permission displayed, it may be that your file has been hacked.

Warning: As a rule, do not ever set any file to have permissions reading 777. This grants read, write, and execute permission to anyone who can access the file. It is just begging someone to hack your server.


Advertisement