Troubleshooting Permissions
Trouble shooting permissions problems can be tricky. Start by checking the existing file permissions:
Unix files have permissions indicated by a code which looks like this:
drwxrwxrwx
|{ }{ }{ } d{user}{group}{others}
The d indicates that the file is a directory. If it is not,
there will be a - (dash) in its place;
The next three letters indicate permissions of the owner (user): read, write,
and execute;
The next three indicate the permissions of the group (this is
only important for files made accessible to a selected group);
The last three indicate the permissions of all others.
For public
directories, the execute permission must be set for everyone.
For public files, the read permission must be set for everyone.
Permissions can be set using "absolute" numerical codes or "symbolic" letter codes. The command chmod (change mode) is used to set and change permissions.
In the numerical code, the first number sets the user permission, the second sets group, and the third sets others. Read permission is 4, write permission is 2, and execute permission is 1; these values are added, so that 4+2+1=7; 4+2+0=6. A code of 711 then means that the user has rwx permissions, and group and other have execute permission only. A code of 644 means that the user has rw permission, and group and other have read permission only.
In the letter codes, u is user (owner), g is group, o is other, and a is all (u, g, and o). Plus and minus signs are used to add or remove permissions, which are indicated by r (read), w (write), and x (execute). So a command of chmod a+r would add (+) read permissions to all.
To check and/or change the permissions,
- Telnet or SSH to mason.gmu.edu
- at the mason> prompt type cd and
hit Enter (This will put you into your home directory).
- To check what directory you're in, you can always type pwd (Present Working Directory). If the directory name is your username, you're home.
- Type ls -l to generate a list of the files, in long format. (Note: there is a space between the s and the -l. And that's a lower-case L, not the numeral one)
- The first column before public_html should look like this:
drwxr-xr-x. If it doesn't, follow these steps
- type chmod 755 public_html and hit Enter
- type ls -l again and check the result. If it is still wrong,
- type cd and hit Enter
- type chmod 711 . and hit Return. (Note: There is a space and a period after 711)
- If the public_html permissions are OK, the individual file permissions may be incorrect.
- Type cd public_html and hit Enter to go to your public_html directory.
- Type ls -l and hit Enter. The file permissions should look like this: -rw-r--r-- or -rwxr-xr-x
- If these are wrong type chmod 644 filename and hit Enter. Replace filename with the name if the actual file.
- To change all of the files, type chmod 644 * (The * is
a "wildcard" character)
- Note: you can also use the letter codes: chmod a+r will add read permission to everyone.
You can also check permissions using the SSH File Transfer client.
To check the public_html perrmissions
- Open SSH File Transfer window (see the instructions on uploading files)
- Right-click on the public_html folder on the remote side.
- Select Properties from the popup menu.
- The permissions for the public_html directory should look
like this (These will be check-marks, not Xs):
Read Write Execute
Owner X X X Group X X Other X X Permission Mode: 755 - To change permissions, just click in the appropriate boxes
To check individual file permissions
- Double-click the public_html icon to move into the public_html directory
- Right-click on a file (such as index.html).
- Select Properties from the popup menu
- The permissions for files should look like this (These will be check-marks,
not Xs):
Read Write Execute
Owner X X Group X Other X Permission Mode: 644 - To change permissions, just click in the appropriate boxes
The next most common problem is Error 404: File Not Found.
Dean Taciuch
GMU English Department
This work is licensed under a Creative
Commons License.