复制 scp 后权限不正确

Kel*_*zle 6 ssh permissions windows-7 clipboard scp

我在 Windows 7 中使用 cygwin 使用此命令将目录复制到 ubuntu 机器。

scp -rp -P 54322 /cygdrive/c/xampp/htdocs/. user@10.136.10.1:/home/user/somefolder/
Run Code Online (Sandbox Code Playgroud)

复制所有文件后,它们都具有“不可读取,不可写入”的权限。有谁知道为什么?

或者,如果我复制 /cygdrive/c/xampp/htdocs//cygdrive/c/Users/user然后使用 scp 复制文件。权限是正确的。

---------- 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
Run Code Online (Sandbox Code Playgroud)

jip*_*pie 2

我在 rsync/ssh 和 cygwin 方面遇到了一些问题,这就是我设法解决的方法:

  • 禁用 acl,因为这些无法正确映射到 Linux ACL
  • 更改之前检查安装选项:

$ 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)
Run Code Online (Sandbox Code Playgroud)
  • 更改 ACL 的设置

cp /etc/fstab /etc/fstab.install

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

  • 要激活新设置,请注销并再次登录

logout ssh Adminstrator@hostname

  • 检查“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)
Run Code Online (Sandbox Code Playgroud)

(抱歉,今天早上似乎无法正确格式化。)