Forbidden You don't have permission to access /~cs116/Tutorials/tutorial5_soln.shtml on this server.The following information will allow you to fix this problem.
Note that this command must be run from within the directory that the file is located. ie, in the example above we would have to run "chmod 755 tutorial5_soln.shtml" from within the Tutorials folder. (See __ on how to find your way around in terminal).
There is a similar command for changing the permissions on an entire folder: chmod -R 755 [foldername]
Note that this command must be run from the directoy that the folder is contained within.
I've made a folder in my u directory called "Chmod-Test" and in it are 2 .txt files that I have created. Calling "ls -l" in this directory gives the following information:
-rwx------ 1 cs116 cs116 23 Feb 21 09:37 test1.shtml -rwx------ 1 cs116 cs116 23 Feb 21 09:37 test2.shtmlAt the beginning of each line are 10 characters. The first character is either "d" or "-" and the next three sets of three can be "rwx", "---" or some combination (ie, "-wx" or "r-x").
It may be more helpful to divide the characters up into columns like so:
1 2 3 4 5 6 - rwx --- --- 1 cs116 cs116 23 Feb 21 09:37 test1.shtml - rwx --- --- 1 cs116 cs116 23 Feb 21 09:37 test2.shtmlColumn 1 is the file type and unimportant for this particular topic.
Column 2 represents the permissions for the user (ie, the creator of the file, presumably you or someone else within the ISG). The user is given in column 5.
Column 3 represents the permissions for the group. In this case the group is "cs116" which is given in column 6.
Column 4 represents the permissions for "others." This will generally be students in the course who are trying to access the file via the course website. By default, they have absolutely no access to the files.
r means that the user/group/other is able to read the file w means that the user/group/other is able to write to the file x means that the user/group/other is able to execute the file a '-' in any of the corresponding spots means that the user/group/other does not have that particular permission.If we call "chmod 755 test1.shtml" and then "ls -l":
-rwxr-xr-x 1 cs116 cs116 23 Feb 21 09:37 test1.shtml -rwx------ 1 cs116 cs116 23 Feb 21 09:37 test2.shtmlAnd so the group and "others" (ie, the students accessing the course website) are now able to read and execute test1.shtml but they cannot write (ie, edit) the file.
The general form of the chmod command is: "chmod who=permissions filename"
where who is a list of letters from u - user who owns the file g - group the file belongs to o - other users a - all of the aboveand permissions is a similar list of r, w, and/or x (as above).
So for example, if we call "chmod go=x test2.shtml" and then "ls -l":
-rwxr-xr-x 1 cs116 cs116 23 Feb 21 09:37 test1.shtml -rwx--x--x 1 cs116 cs116 23 Feb 21 09:37 test2.shtmlIf we now call "chmod ugo=x test2.shtml" (or "chmod a=x test2.shtml) and then "ls -l":
-rwxr-xr-x 1 cs116 cs116 23 Feb 21 09:37 test1.shtml ---x--x--x 1 cs116 cs116 23 Feb 21 09:37 test2.shtmlNotice that the user is no longer able to read or write test2.
-- GradonNicholls - 21 Feb 2013