tips

I upload files into my public_html folder (on Sampson), but it only says "Forbidden" when I try to view them.

This is usually due to the permission settings on your files. By default your permissions are set to:
-rwx------

We realize that this is pretty tight, and we also realize that these next few steps that you have to take to fix this "problem" are annoying, but that's what you get for being a computer science major.

We believe more in security than "ease of use." That is why we decided it was better to "lock" the permissions down more and make you work a little to change that.

If you're going to be making your files visible to the world, you better know exactly what you are doing and how to do it -- your personal files (even though they are in a specific directory) should not just be available to anyone with an Internet connection unless you deliberately change them.

Enough of our philosophy. To change them all you need to do is set the permissions of your public_html directory and any of the files in it that you want to be viewable as,
-rwxr-xr-x

To do this you must first SSH into Sampson.augie.edu. If you do not have an SSH client, you may download one here.

Simply enter sampson.augie.edu as the host/ip. And make sure you select SSH as the protocol.

Once you login with your username and password you are in your home directory. This is where your public_html directory should be (if you already created it by ftp-ing to sampson and making a new folder). If you run the command:
~$ls -al

You can see that what your permissions on all of your files (in that directory) are set to. The command chmod is used to change your permissions.

To see a detailed explanation of what chmod is and how to use it, run the command:
~$man chmod

We won't go into too detailed explanation, but here are the basics:
chmod [options] (user/group/etc that you want to change permissions on)+ or -(the permissions you want to set) filename

The first - in your permissions represents whether the thing you are looking at is a "file," directory, or link, etc. The last nine - represent the read, write, and execute permissions for UsersGroupOther.

For a more detailed explanation of what -rwx------ means go here.

So to change the permissions of your public_html directory and all of the files under it to -rwxr-xr-x you would run these simple commands:
~$chmod -R ugo+r public_html
~$chmod -R ugo+x public_html
~$chmod -R u+w public_html

Now that wasn't so hard. Besides, any computer science major should be able to navigate Linux at the command prompt level and understand basic Linux permissions and how to change them.

Return to the Tips page