This question is a near duplicate of Robert's question but after trying chmod 600 ~/.ssh/config
I still have the same error.
I've tried using cygwin
and MINGW32
to do the chmod 600
. ls -la
returns -rw-------
on cygwin
and returns -rw-r--r--
on MINGW32
.
By these results, cygwin
says that it does have the proper permissions and therefore shouldn't be complaining when I ssh hostname
, however both cygwin
and MINGW32
complain when trying to ssh.
This is similar to the issues I had with gitosis where this article said that I needed to switch over the ssh.exe
files from cygwin
to git
(MINGW32) which did actually fix the issue at the time. However, this fix doesn't seem to be working any more as MINGW32
isn't chmod
ing properly.
Any ideas?
Actually for me none of the above worked.
The inspiration came from http://yifanpeng.blogspot.co.uk/2013/03/cygwin-ssh-tip.html
On linux you would just ensure the owner and group on your
.ssh
dir isjujhar
by executingchown jujhar.jujhar ~/.ssh
where~
is a shortcut for/home/jujhar
The only difference with cygwin on windows is that the
jujhar
group is not created and you have to use theUsers
group. Once that is set then you canchmod
correctly.In my case I did the following and it works great
NB My home directory for my username
jujhar
is set to/cygdrive/c/Users/jujhar
(you can change it in/etc/passwd
. This makes backups and stuff easier for me (Crashplan ftw.)Important note if your Windows is not in US English: the "users" group's name is locale-dependant. If your Windows is in Spanish, you'll have to change the files' ownership with
chown $USER:Usuarios *
The issue was not to
chmod
butchown
the file sincecygwin
said my account wasn't the owner of the file. Confusion was again in thatMINGW32
said I was the owner... Wish I had the skills to fix thechmod
andchown
in their project.