Why does cygwin's scp set the permssions to 000 when copying to Linux?

3

1

When I'm copying files from my Windows box to a Linux box using cygwin's scp, the permissions come out as 000. This doesn't happen when I copy from Linux to Linux, so I'm thinking it's related to some configuration on my Windows box. But where is that configuration?

Edit: Under bash, umask prints 0022. The behavior of scp is the same, whether I'm running bash or CMD.

boatcoder

Posted 2011-08-24T23:25:36.307

Reputation: 500

Answers

6

Here are some other pages discussing the issue. The first is about scp, while the second is about 000 permissions with another programs:

Apparently this is a problem with Cygwin's emulation of Unix-type file permissions on Windows filesystems with ACLs. The solution is to alter Cygwin's /etc/fstab file to make Cygwin ignore ACLs. Copying from one of those:

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 Then stop and start your cygwin processes.

Kenster

Posted 2011-08-24T23:25:36.307

Reputation: 5 474

This worked for me. Transfered files no longer have 000 mode. Not sure why this doesn't have more upvotes. – David Roussel – 2015-04-17T10:22:42.873

0

Run umask to see if the rights are being masked off. The fewer the bits set, the more rights that should be set. umask 022 is a common setting (disabling writing by group and other).

Klox

Posted 2011-08-24T23:25:36.307

Reputation: 1 183

within bash umask is 0022 (which is strange, being 4 digits). Within the cmd prompt (where I am when I'm running scp, it doesn't exist so) it appears to be a builtin command. – boatcoder – 2011-08-25T14:57:54.383

The highest digit is for suid/sgid/sticky, which can be omitted when setting the mask, and, yes, umask is built into the shell. – Klox – 2011-08-25T15:12:57.517

Just came back to the question. I'd love to accept an answer, and while umask does show some things, it's still not an answer to the question. May just be that scp is broken. – boatcoder – 2014-03-24T17:05:59.700