Friday, June 22, 2012

NFSv4 ACL example 5

Creating a drop-box for user webservd on a subdirectory owned by user bob.

bob@box-01:~/dir1 $ mkdir subdir1
bob@
box-01:~/dir1 $ chmod 750 subdir1
bob@
box-01:~/dir1 $ ll -dV subdir1
drwxr-x---   2 bob      staff          2 Jun 20 10:25 subdir1
                 owner@:rwxp-DaARWcCos:-------:allow
                 group@:r-x---a-R-c--s:-------:allow
              everyone@:------a-R-c--s:-------:allow
 
webservd@box-01:/home/bob/dir1 $ ll subdir1
subdir1: Permission denied
total 3
webservd@
box-01:/home/bob/dir1 $ rmdir subdir1
rmdir: directory "subdir1": Search or write permission needed
webservd@
box-01:/home/bob/dir1 $ rm -r subdir1
rm: cannot read directory subdir1: Permission denied

webservd@box-01:/home/bob/dir1 $ cd subdir1
bash: cd: subdir1: Permission denied

bob@box-01:~/dir1 $ chmod A+user:webservd:wxaRcs:allow subdir1
bob@
box-01:~/dir1 $ ll -dV subdir1
drwxr-x---+  2 bob      staff          2 Jun 20 10:34 subdir1
          user:webservd:-wx---a-R-c--s:-------:allow
                 owner@:rwxp-DaARWcCos:-------:allow
                 group@:r-x---a-R-c--s:-------:allow
              everyone@:------a-R-c--s:-------:allow
 
webservd@box-01:/home/bob/dir1 $ ll subdir1
subdir1: Permission denied
total 3
webservd@
box-01:/home/bob/dir1 $ rmdir subdir1
rmdir: directory "subdir1": Search or write permission needed
webservd@
box-01:/home/bob/dir1 $ rm -r subdir1
rm: cannot read directory subdir1: Permission denied

webservd@box-01:/home/bob/dir1 $ cd subdir1
webservd@
box-01:/home/bob/dir1/subdir1 $
webservd@
box-01:/home/bob/dir1/subdir1 $ ll -a
.: Permission denied
total 3

webservd@
box-01:/home/bob/dir1/subdir1 $ echo 'Hello!' > file1
webservd@
box-01:/home/bob/dir1/subdir1 $ ll -a
.: Permission denied
total 3
webservd@
box-01:/home/bob/dir1/subdir1 $ rm *
rm: *: No such file or directory

bob@
box-01:~/dir1 $ cat subdir1/file1
Hello!