Skip to content

Setting up

Simon Byrne edited this page Jan 16, 2024 · 4 revisions

Setting permissions

To give users read/write access to directory:

  1. Set the group of all files/folders
    chgrp -R groupname .
    
  2. Set all files/folders to be group writeable
    chmod -R g+rw .
    
  3. Set the SetGID of all directories (so that any new files inherit the group)
    find . -type d -exec chmod g+s {} \;
    
  4. Set the access control list (ACL) so that any new files are writeable by the group:
    setfacl -d -m group:groupname:rwx .
    
    On GPFS file systems, such as the Central, you will need to use mmputacl:
    mmputacl -i aclfile .
    
    where aclfile contains something like:
    #NFSv4 ACL
    #owner:spjbyrne
    #group:hpc_esm
    special:owner@:rw-c:allow:FileInherit
     (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
     (-)DELETE    (-)DELETE_CHILD (X)CHOWN        (-)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED
    
    special:owner@:rwxc:allow:DirInherit
     (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
     (-)DELETE    (X)DELETE_CHILD (X)CHOWN        (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED
    
    special:group@:rw--:allow:FileInherit
     (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
     (-)DELETE    (-)DELETE_CHILD (-)CHOWN        (-)EXEC/SEARCH (-)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
    
    special:group@:rwx-:allow:DirInherit
     (X)READ/LIST (X)WRITE/CREATE (X)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
     (-)DELETE    (X)DELETE_CHILD (-)CHOWN        (X)EXEC/SEARCH (-)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
    
    special:everyone@:----:allow
     (-)READ/LIST (-)WRITE/CREATE (-)APPEND/MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
     (-)DELETE    (-)DELETE_CHILD (-)CHOWN        (-)EXEC/SEARCH (-)WRITE_ACL (-)WRITE_ATTR (-)WRITE_NAMED
    
Clone this wiki locally