Polaris: How Do I Set Permissions on a File or Folder?

Polaris: How Do I Set Permissions on a File or Folder?

There are several methods to set permissions on your file and directories. As an overview, your home directory is a subset of a broader set including all user and student directories.

Step 1

If you are building a Web site, your www/ directory is one directory level below your account home directory. All web content must be located in the www/ directory for it to be viewable on your web site.

Step 2

To allow others to view your web site, you must grant executable access to all folders in the path to your web site. The system administrators have already granted executable rights to everyone for the top three folders: /, users/ and student/. The same permissions will also need to be set to your home directory (in the above example jsmith9/), www/ and all folders within the www/ directory.

In addition, read access will need to be set for all files within the www/ directory.

Methods for Setting Permissions

Using Coreftp:

Step 1

Open Coreftp and log into your Polaris account.

Step 2

Changing permissions using CoreFTP is accomplished by right-clicking on the file or folder and selecting Properties.

Step 3

To set the permissions, either enter the number that represents the permission for the directory/file or use the check boxes to set the permissions you need.

Permissions on most folders should be 711 , and permissions on most files should be 644 as shown in the images to the right.

When done, click OK

For folders:

For file:

Step 4

To set the permissions on your home directory, double click on the folder named <..> to move one directory level above your home directory

Step 5

Scroll down through the list until you locate the folder with your userid name. Once located, right click on your userid folder, select properties and set the permissions on this to the 711 level as you did in steps 2 and 3 above.

Step 6

Once the permissions on set to 711 on the folder with your userid, double click on the folder with your userid to move back into your account home directory.

Your account and files should now be configured correctly to view your web pages.

Using the Command Line (also known as the Terminal):

Step 1

Use an ssh client such as putty or portaputty to log into your Polaris account.

Step 2

At the Polaris prompt, you will use the chmod command to set the permissions on your home directory and www directory. Note, when transferring files to your account with an ftp program, the files should transfer over with the proper permissions automatically set.

Step 3

Make sure you are in your accounts home directory. You can do this by typing cd at the Polaris prompt:

Polaris> cd

and press enter

Step 4

To set the permissions on your home directory, type the following:

Polaris> chmod 711 .

And press enter. Make sure you include the space before 711 and after 711 and you include the period on the end of the command. On Unix, the period is used to specify "current directory" location. In this command you are setting the permission to 711 for the current directory location (your home directory)

After pressing enter, you will be returned to the Polaris prompt

Step 5

To verify the permissions were set correctly, type:

Polaris> ls –ld .

and press enter. This command has two lowercase L's, a space after the s, a space after the d and a period on the end of the command.

Step 6

If your typed the command correctly to change your home directory permissions to 711, you should see something similar to:

drw--x—x

in the left most column. This shows a permission level of 711.

Step 7

To set the permissions on your www directory, type the following at the Polaris prompt:

Polaris> chmod 711 www

Step 8

To verify the permissions were set correctly on your www directory, type the following at the Polaris prompt:

Polaris> ls –ld www

Again, the left column of the results should show the drw--x—x permission level.

Note: Files and directories that are transferred using an sftp program (such as Coreftp), into your www directory on Polaris should transfer over to Polaris with the proper permission level and you shouldn't need to set them manually.