I have two users testuser2 and testuser1 with homedirectories /home/testuser2 and /home/testuser1 respectively. I want to share the directory /home/testuser1/Videos/ and its contents across these two users. I did the following :
- Created a group named ggg and added both users testuser2 and testuser1 to it
- Changed the ownsership of /home/testuser1/Videos to testuser1:ggg from testuser1:testuser1
- Set acl to group ggg having permission rwx on /home/testuser1/Videos
- Set sgid to the directory /home/testuser1/Videos
Now I created a soflink to /home/testuser1/Videos inside the directory /home/testuser2/Desktop/testuser1 so that both testuser1 and testuser2 would be able to add/edit/remove directories. While testing I came across the following scenarios which I would like to get clarification you guys.
A) Copying files by testuser1 :
I have copied a file from /home/testuser1 (say examplefile1 testuser1:testuser1 644 ) to /home/testuser1/Videos and I could see that the ownership of the file changed to testuser1:ggg successfully.
1.How can I change the permission also automatically to the one I need (group permision to rwx) if someone is copying files to my destination?
- If I am copying a file with 444 permission, then testuser2 wont be able to write to it. Thats normal since it is 444, but he is able to delete it. How ?
B) Moving files by testuser1 :
Comparing with the copying, while moving the files, ownership is not changing to testuser1:ggg. It keeps testuser1:testuser1 and keeps what the actual permission is.
- How can I change the permission AND ownership to the one I required automatically ?
- Same case as copying, testuser2 is able to delete the file but not able to write if the file is having permission read only.Why ?
I have tried to explain as possible. Please let me know the answers for A and B sections.