Skip to content

File Permission in Research Space

A user with account name User1 is not able to access a directory Dirct in his research space Group1. The following is the result of the ls command:

1
2
3
4
5
6
7
8
[User1@dev-intel18 ~]$ ls -la /mnt/research/Group1
total 98
drwxrwS---   3 ProjInvs Group1 8192 Aug  6 08:53 .
drwxr-xr-x 391 root     root      0 Sep  9 07:34 ..
-rwx------   1 User2    Group2 4299 Jul  2  2018 file1
-rwx------   1 User3    Group3 2452 Jul  2  2018 file2
drwxrwS---   2 User2    Group2 8192 May 22 11:31 Dirct
-rw-rw-r--   1 User1    Group1  263 Aug  6 08:54 file3

Q: How to make User1 able to access the directory Dirct?

A: Since User2 is the owner of the directory, User2 can run a  command to change the group ownership:

1
[User2@dev-node ~]$ chgrp -R Group1 /mnt/research/Group1/Dirct

Q: In order for all group users able to access files and directories in the research space, what should they do?

A: They should run the following commands:

  1. Change the group ownership of all files and directories to the research group Group1:

    1
    [UserID@dev-node ~]$ chgrp -R Group1 /mnt/research/Group1/ 2>/dev/null
    
  2. Open the permissions of all files and directories to be readable (r) and writable (w) to group users:

    1
    [UserID@dev-node ~]$ chmod -R g+rw /mnt/research/Group1/ 2>/dev/null
    
  3. Make all directories sticky to the group ownership for any file generated inside (turn on group sticky bits):

    1
    [UserID@dev-node ~]$ chmod g+s $(find /mnt/research/Group1/ -type d -user $USER 2>/dev/null)
    
  4. Group users should not copy files to their research space with preserving the ownership, such as using command "cp -p ... ".