无忧启动论坛

标题: 问问关于acl问题 [打印本页]

作者: yjd    时间: 2010-5-5 19:47
标题: 问问关于acl问题
比如公司服务器设置了不同帐号,不同部门组
利用ntfs的权限设置不同文件夹为不同部门,不同用户访问权限。

如果重装系统以后再重新配置那么多文件夹那是很悲剧的,不知道有没有好用的gui工具或其它什么的可以解决这个问题?(这个问题郁闷很多年了)

2003 sp2后有一个小工具——icacls.exe 命令行不理想
作者: dato    时间: 2010-5-5 20:32
这个应该很简单的吧,

不过至今net user命令没怎么研究,但是NTFS权限还是弄了很多次了


set cc=e:\w3\php
takeown /f %cc% /R /D Y
Xcacls.exe %cc% /t /c /g fdiy:r /Y
Xcacls.exe %cc% /t /e /c /g www:r /Y
net start apache2
net stop mysql

set dd=e:\w3\mysql
takeown /f %dd% /R /D Y
Xcacls.exe %dd% /t /c /g fdiy:r /Y
Xcacls.exe %dd% /t /e /c /g mysql:r /Y
Xcacls.exe %dd%\data /t /c /p fdiy:f /Y
Xcacls.exe %dd%\data /t /e /c /p mysql:c /Y
net start mysql
作者: yjd    时间: 2010-5-5 21:12
要是有个能把整个分区的acl备份,然后重装系统的时候恢复就好了。
看来只能像你实现把所有的都写成批处理,然后。。。
我的目录是分
        a部门
  a同事  b同事 公用目录

有的目录是继承有的则是单独。上下级目录有的带读写有的只读有的全部权限。工作量还是大-_-!!
作者: dato    时间: 2010-5-5 23:58
http://setacl.sourceforge.net/html/examples.html

http://www.bog.no/index.php?option=com_content&view=article&id=2:how-to-backup-ntfs-acl

Written by Administrator   
Friday, 26 February 2010 12:42
Copy/backup/document ACL with SetACL.exeThis method works when you just want to copy ACLs without the hole file. It seems like xcopy just works with the hole file, and Robocopy doesn't work over shares. At least I haven't got it working...

Download SetACL from setacl.sf.net and put it in a folder that is in your PATH (eg. /windows/system32)

SetACL.exe -on "\\server1\share" -ot file -actn list -lst "f:sddl;w:d,s,o,g" -rec cont -bckp "f:\setacl-liste.txt"

Creates a complete listing of DACL, SACL, owner and primary group in SDDL format of the directory '\\server1\share1\users' and all sub-folders. The listing is stored in unicode format in the file specified.

When you need to copy this ACLs to another server:

Open f:\setacl-liste.txt > "Replace All" from Server1 to Server2 and do a restore from the new file.

SetACL.exe -on "dummy entry" -ot file -actn restore -bckp "f:\setacl-liste-srv01.txt"

Restores all (!) security descriptor data (DACL, SACL, owner, primary group) from the backup file to its original location.

BEWARE: If you have the appropriate user rights (usually, being a member of the administrators group on the target system is sufficient) ALL data in the security descriptor is overwritten!

Comment: Only data contained in the backup file is overwritten, ie. if you create a backup of the SACL only, when you restore it, the DACL, owner and primary group are left unchanged!



Last Updated on Friday, 30 April 2010 13:31

作者: yjd    时间: 2010-5-6 12:53
原帖由 dato 于 2010-5-5 23:58 发表
http://setacl.sourceforge.net/html/examples.html

http://www.bog.no/index.php?option=com_content&view=article&id=2:how-to-backup-ntfs-acl

Written by Administrator    Friday, 26 February 2010 ...


谢谢,看样子不错。




欢迎光临 无忧启动论坛 (http://wuyou.net/) Powered by Discuz! X3.3