Misunderstanding about linux permisions, groups
0
votes
0
answers
76
views
Recently i have desided to create autobackups from my host to a little backup server by using ssh + rsync.
I have created separate user for this task "backuppc", have created "shared group", and have changed mountpoint for my data from main user home folder to /data. So, now it looks like /data{Media, Work} and etc.
Then i have tried to set "correct permissions" for my opinion. First, i add my main user "serg" and user for backupp task "backuppc" to shared group. I have changed permissions for shared folders to something like this:
# file: data/Media/
# owner: serg
# group: shared
# flags: -s-
user::rwx
group::rwx
other::---
default:user::rwx
default:group::rwx
default:group:shared:rwx
default:mask::rwx
default:other::---
"Correct permissions" i see something like this: group of backup resources should be "shared", it should have read and write permissions, and "other" should not have any permission. I have changed default mask and mask by setfacl utility, set sticky bit for inheriting attributes from parent folder.
After all this steps, i thought that when i copy/move any file from my home directory, which have different group owner, to my "/data" resources, group will be overwritten by "shared" group and will get read and write permissions.
However, when i copy or move file with another group owner it still same and not inherit default mask of shared resources. Even when i try to save any file from firefox to shared resources folders it gets only read permissions for shared group. But default mask for group is "rwx". I understand, that i can use umask, but i think that is too difficult for this simple task.
Now i thing that something is wrong with my backup idea. Maybe i misunderstand something, could you give my some advice? I just want, that any file which will be placed/copy/moved in shared resources inherit "shared" group "rwx" permission. Or maybe i should do this in another way? Thank you.
PS For changing permissions i have used setfacl utility, chown and chmod.
chown -R :shared /data/Media
Now, i set sticki bit and set read, write and execute permissions for directory.
chmod -R g+swrx /data/media
Next, i have used setfacl for set default permissions for group:
setfacl -R -dm "g:shared:rwx" /data/Media
PS Here ls -ld output
drwxrws---+ 15 serg shared 4096 авг 16 22:21 /data/Media/
Asked by One
(13 rep)
Aug 16, 2023, 06:46 PM
Last activity: Aug 17, 2023, 05:39 PM
Last activity: Aug 17, 2023, 05:39 PM