0
0
My OS is Windows XP, Cygwin 2.5.2. After installing the new version, I had to reinstall the old one that works on Windows XP. But now in my .ssh folder I can't change file permissions under any user in the OS:
$ ls -la
total 17
drwxr-xr-x+ 1 my_user None 0 Jun 25 16:34 ./
drwxr-xr-x+ 1 my_user None 0 Jun 25 16:40 ../
-rwxr-xr-x+ 1 my_user None 493 Jun 19 02:32 config*
-rwxr-xr-x+ 1 my_user None 668 Mar 19 2011 id_dsa*
-rwxr-xr-x+ 1 my_user None 612 Feb 19 2011 id_dsa.pub*
-rwxr-xr-x+ 1 my_user None 1675 Mar 24 2011 id_rsa*
-rwxr-xr-x+ 1 my_user None 404 Mar 24 2011 id_rsa.pub*
-rwxr-xr-x+ 1 my_user None 3788 Jun 16 01:57 known_hosts*
-rwxr-xr-x+ 1 my_user None 1464 Jul 7 2016 rsa_putty.ppk*
I am logged in as my_user
and tried to run:
$ chmod 200 ./id_rsa
chmod: changing permissions of './id_rsa': Permission denied
I tried to do the same as Administrator - the same result. Seems, that something broke during the reinstallation of Cygwin. Is it possible to fix?
Update
$ cacls ./id_rsa
d:\bin\cygwin\home\my_user\.ssh\id_rsa ORGANIZA-R2ODEV\my_user:F
CREATOR OWNER:(OI)(CI)(IO)F
ORGANIZA-R2ODEV\None:R
CREATOR GROUP:(OI)(CI)(IO)R
Everyone:(OI)(CI)R
$ getfacl ./id_rsa
# file: ./id_rsa
# owner: my_user
# group: None
user::rwx
group::r-x
other:r-x
default:user::rwx
default:group::r-x
default:other:r-x
The trailing
– AFH – 2017-07-08T16:27:54.717+
on the permissions means that there are extended permissions on the file you are trying to change. See here. You will needgetfacl
andchacl
to resolve this. (This is based on standard Linux: I have assumed thatCygWin
is similar.)What is the output of cygwin
id
and of windowscacls id_rsa
? – matzeri – 2017-07-08T16:35:38.430@matzeri Added the output to the question – user4035 – 2017-07-08T17:16:44.253
@AFH Please, look at the update. – user4035 – 2017-07-08T17:19:33.623
OK. It looks as though the trailing
+
is misleading, as there seems to be no ACL. But the mode 0200 is odd: it is very rare to have write-only files, and Windows file systems don't support it, thoughCygWin
may have its own permissions overlaying those of Windows. Can you set other permissions, eg 0700 or 0750? – AFH – 2017-07-08T18:12:05.467@AFH
Can you set other permissions, eg 0700 or 0750?
- no, the same error: "Permission denied" – user4035 – 2017-07-08T18:18:44.707@AFH It seems weird but after moving .ssh folder out of my cygwin home folder, I changed the permissions successfully. So the issue was not inside the directory, by outside it. What can it be? – user4035 – 2017-07-08T18:28:25.323
Do you have write permission on
~/.ssh
(runls -ld ~/.ssh
to check)? I don't know what else to suggest, but in searching for information oncygwin chmod
I found lots of error reports. Maybe you have encountered one of those bugs. – AFH – 2017-07-08T18:34:26.540@AFH "Do you have write permission on ~/.ssh (run ls -ld ~/.ssh to check)?" - yes, I have write permissions. Weird bug, upvoted couple of your posts. Thanks. – user4035 – 2017-07-08T18:44:43.323