I have a folder /mnt/disk/folder.
I want
user1anduser2to both have full recursive read+write access to any current and future directories and files.I want to symlink the folder to
/home/user1/data/and/home/user2/data/with access rights maintained.
This is what I have done:
Make the directory
mkdir /mnt/disk/folder
Symlink the to the directory
ln -s /mnt/disk/folder /home/user1/data ln -s /mnt/disk/folder /home/user2/data Make a group for sharing
sudo groupadd sharing
Add users to that group
sudo usermod -a -G sharing user1 sudo usermod -a -G sharing user2 Chown all existing files (not any in this case) to belong to the group
sudo chgrp -R sharing /mnt/disk/folder
Make all existing files (not any in this case) group-read-write
sudo chmod g+rw -R /mnt/disk/folder
Ensure that all newly created files and directories will belong to the group
chgrp sharing /mnt/disk/folder chmod g+s /mnt/disk/folder If logged in as user1 doing mkdir /home/user1/data/folder/123it works. As does cd 123 and >test.txt.
If then logging in as user2 and navigating to /home/user1/data/folder/, the stuff created by user1 is there, and both users can create, edit, and remove directories and files.
I run a JupyterHub server, however, where user1 and user2 access their directories through jupyter's browser interface. When creating and editing here, permissions do NOT work.