Hi everyone,
I created a new ZFS dataset
and assigned read and write permissions to the "labgroup" group
I then switched to user "lab1" that is part of "labgroup" and created a test file and directory
I then tried changing the permissions of the mounted dataset
and all of a sudden the permissions I first had didn't work anymore
I even tried resetting the permissions to how they were before but still couldn't write to the directory
This sort of problem seems kind of randomic in the sense that if I destroy and recreate the same dataset it might not work and if I recreate it once again it might work.
Is there something I am missing or do not understand regarding ZFS datasets and permissions or permissions in general?
I have just noticed that it seems I have the same kind of issue on other datasets
I created a new ZFS dataset
Code:
root@vieron:~ # zfs create zroot/playground
root@vieron:~ # ls -ld /zroot/playground/
drwxr-xr-x 2 root wheel 2 Mar 17 12:40 /zroot/playground/
and assigned read and write permissions to the "labgroup" group
Code:
root@vieron:~ # chmod 775 /zroot/playground/
root@vieron:~ # chown :labgroup /zroot/playground/
root@vieron:~ # ls -ld /zroot/playground/
drwxrwxr-x 3 root labgroup 5 Mar 17 12:41 /zroot/playground/
root@vieron:~ #
I then switched to user "lab1" that is part of "labgroup" and created a test file and directory
Code:
root@vieron:~ # id lab1
uid=1001(lab1) gid=1001(lab1) groups=1001(lab1),0(wheel),1004(labgroup)
root@vieron:~ # su - lab1
lab1@vieron:~ $ cd /zroot/playground/
lab1@vieron:/zroot/playground $ touch test
lab1@vieron:/zroot/playground $ mkdir testdir
lab1@vieron /zroot/playground % ls
test testdir
lab1@vieron /zroot/playground %
I then tried changing the permissions of the mounted dataset
Code:
root@vieron:~ # chmod g+s /zroot/playground/
root@vieron:~ # ls -ld /zroot/playground/
drwxrwsr-x 3 root labgroup 5 Mar 17 12:41 /zroot/playground/
root@vieron:~ #
and all of a sudden the permissions I first had didn't work anymore
Code:
lab1@vieron /zroot/playground % touch newfile
touch: newfile: Permission denied
lab1@vieron /zroot/playground % mkdir newdir
mkdir: newdir: Permission denied
lab1@vieron /zroot/playground %
I even tried resetting the permissions to how they were before but still couldn't write to the directory
Code:
root@vieron:~ # chmod g-s /zroot/playground/
root@vieron:~ # ls -ld /zroot/playground/
drwxrwxr-x 3 root labgroup 5 Mar 17 12:41 /zroot/playground/
root@vieron:~ #
lab1@vieron /zroot/playground % touch newfile
touch: newfile: Permission denied
lab1@vieron /zroot/playground % mkdir newdir
mkdir: newdir: Permission denied
lab1@vieron /zroot/playground %
This sort of problem seems kind of randomic in the sense that if I destroy and recreate the same dataset it might not work and if I recreate it once again it might work.
Code:
root@vieron:~ # zfs destroy zroot/playground
root@vieron:~ # zfs create zroot/playground
root@vieron:~ # chmod 775 /zroot/playground/
root@vieron:~ # chown :labgroup /zroot/playground/
root@vieron:~ #
lab1@vieron ~ % cd /zroot/playground
lab1@vieron /zroot/playground % touch newfile
touch: newfile: Permission denied
lab1@vieron /zroot/playground % mkdir newdir
mkdir: newdir: Permission denied
lab1@vieron /zroot/playground %
Is there something I am missing or do not understand regarding ZFS datasets and permissions or permissions in general?
I have just noticed that it seems I have the same kind of issue on other datasets
Code:
lab1@vieron /testdir % ls -ld .
drwxrwxr-x 2 root labgroup 2 Mar 17 14:20 .
lab1@vieron /testdir % ls
lab1@vieron /testdir % touch test
touch: test: Permission denied
lab1@vieron /testdir %
lab1@vieron /testdir % id lab1
uid=1001(lab1) gid=1001(lab1) groups=1001(lab1),0(wheel),1004(labgroup)
lab1@vieron /testdir %