是否可以在Windows服务器上的文件夹上设置组权限,以便可以创build,填充和closures文件,但之后没有更改或删除?
你可以设置权限来允许这个,但是你可能会发现你对结果不满意。 (我还没有configuration这个客户谁已经要求它,而不必在几天后改变它。)
特别是一些程序(微软的Word就是一个很好的例子),假设他们可以用一个名字写文件,然后在写之后重命名它们。 其他程序创build文件,closures文件,然后重新打开它再次写入。 当这样的程序试图写入一个像你所描述的权限的目录时,你会发现事情中断了。
如果你只是将文件复制到这样一个目录,你可能会有更好的运气。
我们假设你想要“authentication用户”能够做到这一点。 您需要使用“高级”ACL编辑器添加最后的权限:
SYSTEM - Full Control - Apply onto: This folder, subfolders, and files Administrators - Full Control - Apply onto: This folder, subfolders, and files Authenticated Users - Read - Apply onto: This folder, subfolders, and files Authenticated Users - Create Files / Write Data - Apply onto: This folder and subfolders
这将允许“身份validation的用户”创build新文件,但他们将无法修改他们刚创build的文件。 (显然,SYSTEM和Administrators的成员将能够操纵这些文件。)
埃文的回答非常有帮助。 在这里,我写了一个PowerShell脚本来减less它的实践。
$worm="C:\WORM" mkdir -Force $worm cd $worm <# https://serverfault.com/a/17869 SYSTEM - Full Control - Apply onto: This folder, subfolders, and files Administrators - Full Control - Apply onto: This folder, subfolders, and files Authenticated Users - Read - Apply onto: This folder, subfolders, and files Authenticated Users - Create Files / Write Data - Apply onto: This folder and subfolders #> $acl = Get-Acl $worm $ace1 = New-Object Security.AccessControl.FileSystemAccessRule 'Users', ` 'CreateDirectories, CreateFiles, ListDirectory, Read', ` 'ContainerInherit, ObjectInherit', ` 'None', ` 'Allow' $acl.AddAccessRule($ace1) Set-Acl -AclObject $acl -Path $worm $acl = Get-Acl $worm $ace1 = New-Object Security.AccessControl.FileSystemAccessRule 'Users', ` 'DeleteSubdirectoriesAndFiles,Delete', ` 'ContainerInherit, ObjectInherit', ` 'None', ` 'Deny' $acl.AddAccessRule($ace1) Set-Acl -AclObject $acl -Path $worm $acl = Get-Acl $worm $ace1 = New-Object Security.AccessControl.FileSystemAccessRule 'Users', ` 'WriteData', ` 'ObjectInherit', ` 'InheritOnly', ` 'Deny' $acl.AddAccessRule($ace1) Set-Acl -AclObject $acl -Path $worm