3

I have add nfs4 acl for a directory in nfs client, but can not use "chown/chgrp" after add nfs4 acl, now I want to give up nfs4 acl, and back to original linux simple access control, how to ???

In standard linux acl, we can use setfacl -bn xxx file to remove all acl, and back to original access control, but I do not know how to do it by nfs4_setfacl...

Levin
  • 141

2 Answers2

1
  1. Create a random file to see the default NFS4 ACL: touch /tmp/foo
  2. Store the default ACLs in a file: nfs4_getfacl /tmp/foo > /tmp/fooacl.txt
  3. Restore recursively the ACL in repo BAR: nfs4_setfacl -R -S /tmp/fooacl.txt /path/to/BAR

You could also use a find command if the -R is too scary:

find /path/to/BAR -exec nfs4_setfacl -S /tmp/fooacl.txt {} \;

I would not recommand the solution from kofemann if you need to do something recursively. Or be sure to test it before applying it on your $HOME. I had a bad result on a test that locked me out of my own repository.

0

My solution will be as:

nfs4_getfacl <file> | nfs4_setfacl -X - <file>
kofemann
  • 5,151