2

I'm trying to copy files between two Windows Server machines. Have installed cygwin 1.7.23 on both server. The script is run by the SYSTEM user. The problem is that the files are no longer accessible when logged in as Administrator user although the permissions were copied, verified using ls -l from cygwin. ("You don't currently have permission to access this folder").

Important observation: This problem reproduces only when coping files from remote to local computer. Coping from local to remote works.

  1. Tried using rsyc with the following options:

    rsync -hrtavpe "ssh"

  2. Tried adding default permissions using rsync's chmod option

    --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r

  3. Edited the C:\cygwin\etc\fstab file as suggested in this post [1]

Created two folders logged in as SYSTEM user:

  • The first one created using rsync is NOT accessible (folder_copied_with_rsync).

  • The second one is created with mkdir and is accessible (folder_created_manualy)

Output of icalcs (from cmd) and ls -l (from cygwin):

C:\NgNMS>icacls folder_copied_with_rsync
folder_copied_with_rsync NT AUTHORITY\SYSTEM:(F)
                         NT AUTHORITY\SYSTEM:(RX,W,DC)
                         BUILTIN\Users:(DENY)(W,RD,REA,X,DC)
                         NT AUTHORITY\SYSTEM:(Rc,S,RA)
                         BUILTIN\Users:(RX,W,DC)
                         Everyone:(Rc,S,RA)
                         CREATOR OWNER:(OI)(CI)(IO)(F)
                         NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(RX,W,DC)
                         CREATOR GROUP:(OI)(CI)(IO)(RX,W,DC)
                         BUILTIN\Users:(OI)(CI)(IO)(RX,W,DC)
                         Everyone:(OI)(CI)(IO)(Rc,S,RA)

Successfully processed 1 files; Failed processing 0 files

C:\NgNMS>icacls folder_created_manualy
folder_created_manualy NT AUTHORITY\SYSTEM:(F)
                       NT AUTHORITY\SYSTEM:(RX,W,DC)
                       NT AUTHORITY\SYSTEM:(RX,W,DC)
                       BUILTIN\Users:(RX,W,DC)
                       Everyone:(Rc,S,RA)
                       CREATOR OWNER:(OI)(CI)(IO)(F)
                       NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(RX,W,DC)
                       CREATOR GROUP:(OI)(CI)(IO)(RX,W,DC)
                       BUILTIN\Users:(OI)(CI)(IO)(RX,W,DC)
                       Everyone:(OI)(CI)(IO)(Rc,S,RA)

Successfully processed 1 files; Failed processing 0 files


ls -l
drwxrwx---+ 1 SYSTEM         SYSTEM       0 Apr 19 15:00 folder_copied_with_rsync
drwxrwx---+ 1 Administrators Domain Users 0 Apr 20 11:55 folder_created_manualy

[1] Rsync on Windows: wrong permissions for created directories

Community
  • 1
  • 1

0 Answers0