Ubuntu – incorrect permissions after copying over scp

clipboardpermissionsscpsshwindows 7

I'm using cygwin in windows 7 to copy a directory to an ubuntu machine using this command.

scp -rp -P 54322 /cygdrive/c/xampp/htdocs/. user@10.136.10.1:/home/user/somefolder/

After copying all the files, they all have "no read, no write" permissions. Does anyone know why?

Alternatively if I copy /cygdrive/c/xampp/htdocs/ to /cygdrive/c/Users/user and then use scp to copy the files. The permissions are correct.

---------- 1 user user 1273 Apr 21 16:32 about.html
---------- 1 user user 1707 Apr 21 16:33 contact.html
d--------- 2 user user 4096 Apr 21 04:14 images
---------- 1 user user 2259 Apr 21 22:27 index.html
---------- 1 user user 1252 Apr 21 16:33 projects.html
---------- 1 user user  823 Apr 22 22:03 style.css
drwx------ 6 user user 4096 Apr 21 02:11 xampp

Best Answer

I've had some issues with rsync/ssh and cygwin, this is how I managed to solve:

  • Disable acl's as these cannot be properly mapped to Linux ACL's
  • Check mount options before changing:

$ mount

D:/ProgramsVista/ICW/etc/terminfo on /usr/share/terminfo type ntfs (binary,noacl)
D:/ProgramsVista/ICW/bin on /usr/bin type ntfs (binary,noacl)                    
D:/ProgramsVista/ICW/lib on /usr/lib type ntfs (binary,auto)                     
D:/ProgramsVista/ICW on / type ntfs (binary,noacl)                               
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)                  
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)                  
E: on /cygdrive/e type iso9660 (binary,posix=0,user,noumount,auto)
  • Change setting for ACL's

cp /etc/fstab /etc/fstab.install

echo "none /cygdrive cygdrive binary,posix=0,user,noacl 0 0" >> /etc/fstab

  • To activate the new setting, logout and login again

logout ssh Adminstrator@hostname

  • Check the new setting for "noacl":

$ mount

D:/ProgramsVista/ICW/etc/terminfo on /usr/share/terminfo type ntfs (binary,noacl)
D:/ProgramsVista/ICW/bin on /usr/bin type ntfs (binary,noacl)
D:/ProgramsVista/ICW/lib on /usr/lib type ntfs (binary,auto)
D:/ProgramsVista/ICW on / type ntfs (binary,noacl)
C: on /cygdrive/c type ntfs (binary,noacl,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /cygdrive/e type iso9660 (binary,noacl,posix=0,user,noumount,auto)

(sorry can't seem to get the formatting right this morning.)

Related Question