In a project space, there is a default set of permissions for directories and files. This is usually rwxrwx---, which means read/write/execute for the USER (the first three letters listed 'rwx') and the project GROUP (the second group of three listed, also 'rwx'). The final triplet, usually not set, is for ‘WORLD’. Any files originating on the grid will usually have the permissions ‘rwxrwx---’ in a project space.
drwxrwx--- USERGROUPWORLD ‘d’ indicates a directory
Here is a sample listing from a project.
In directory /export/projects/generic_project, enter this command line to get the directory listing. (These are lower case 'L's; there is a space between 'ls' and '-la'.)
researchgrid$ 'ls –la'
-rw-r----- 1 jharvard rcs_project_generic 241215 Jul 30 2015 Article_d1.pdf
The permissions on this file saved by a group member to the space are read/write (user 'rw-') and read only (group 'r- -'). ‘jharvard’ is the file owner and ‘rcs_project_generic’ is the group name. The permissions may have changed when the file was dragged and dropped from a desktop to a drive mapped to the drive in grid storage. The person listed as 'owner' of a file (eg. ‘jharvard’) is the only person who can change the permissions. To change the permissions on the file listed above to 'rwxrwx', there are two ways to express the change on the unix command line:
Option 1: Add 'execute' to the owner’s ("user") permissions
researchgrid$ chmod u+x *.pdf
Option 2: Alternate way to add 'execute' to the owner’s ("user") permissions.
‘r’ has value of 4, ‘w’ is 2, ‘x’ is 1, so ‘rwx’ for owner is 7 (4+2+1)
researchgrid$ chmod 700 *.pdf
Here are the same two options to add 'read' and 'write' to the group members.
researchgrid$ chmod g+rw *.pdf
<or> ‘rw’ for group is 5 (4+1)
researchgrid$ chmod 750 *.pdf
The result would look like this:
researchgrid$ ls –la
-rwxrwx--- 1 jharvard rcs_project_generic 241215 Jul 30 2015 Article_d1.pdf
When using a shared project space, group members should routinely check the permissions on files they have added to (and used in) the space. To check, group members need to log on to the grid using SecureCRT (PC), a terminal session (Mac) or a terminal window in NoMachine to check the permissions on the files which lists them as the owner. In the above case, the owner would need go to the project directory then type the command line to list the directories and files:
researchgrid$ cd /export/projects/generic_project
researchgrid$ ls –la
Please note that file permissions cannot be changed from an explorer window on a desktop. If a person has a number of files in various directories and subdirectories in a project space, a command can be issued from 'top' directory of the project space to recursively change permissions on all files they own. Since files may have different combinations of permissions, here is a simple way to ensure 'rwxrwx' for all files:
researchgrid$ chmod –R 770 *
Alternate permissions might be 'rwx'(owner) and 'r-x' (group) when the owner wants other group members to read and execute the file, but not to overwrite it:
researchgrid$ chmod –R 750 *