Sharing Files
In the following commands are shown for giving members of a Unix group read permission to files in a sub-directory of an existing base directory.
Never give write permissions to any other user, not even to members of your working group! |
Names used in commands
$WORK
is an existing base directory- e.g.
WORK=/work/username
- e.g.
groupname
is the name of an existing Unix group- on Hummel all members of a working group are members of a corresponding Unix group
hpc_ag_group
- the exact name of the Unix group can be found in the output of the
id
command
- on Hummel all members of a working group are members of a corresponding Unix group
groupdata
is the name of a directory to be shared
Commands for a new directory
mkdir $WORK/groupdata chgrp groupname $WORK chgrp groupname $WORK/groupdata chmod g+x $WORK chmod g+rxs $WORK/groupdata
Commands for an existing directory
chgrp groupname $WORK chgrp -R groupname $WORK/groupdata chmod g+x $WORK chmod -R g+rX $WORK/groupdata find $WORK/groupdata -type d -exec chmod g+s {} \;
Explanations of commands
Links to Wikipedia: