Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 chmoding properly.

Any ideas?

share|improve this question
Make sure the permissions are reasonably restrictive on all ancestor directories as well. For example, chmod 700 ~/.ssh and chmod 755 ~. – 200_success Jul 7 '11 at 21:30
That worked. Thanks! Please add as an answer and I'll accept. – user29600 Jul 11 '11 at 19:07
Also had to chown _UserName_ config. According to cygwin I wasn't the owner of the file, although MINGW32said I was. – user29600 Jul 11 '11 at 19:36

Actually for me none of the above worked.

The inspiration came from

On linux you would just ensure the owner and group on your .ssh dir is jujhar by executing chown 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 the Users group. Once that is set then you can chmod correctly.

In my case I did the following and it works great

chown jujhar.Users /cygdrive/c/Users/jujhar/.ssh
chmod 0700 /cygdrive/c/Users/jujhar/.ssh
chmod 0600 /cygdrive/c/Users/jujhar/.ssh/*

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.)

share|improve this answer

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 *

share|improve this answer
up vote 0 down vote accepted

The issue was not to chmod but chown the file since cygwin said my account wasn't the owner of the file. Confusion was again in that MINGW32 said I was the owner... Wish I had the skills to fix the chmod and chown in their project.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.