Just recently I rebuilt a system that I use for work. After I installed Cygwin on it, I started getting some weird errors when using git with ssh to do some source control tasks.
When doing a fetch, pull or push to/from origin, or really any git command that uses ssh to communicate, the ssh client would complain with the error:
1 2 3 4 | Could not create directory '/home/jgg/.ssh'. The authenticity of host 'github.com (204.232.175.90)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? |
Once I enter yes
, I get the following:
1 | Failed to add the host to the list of known hosts (/home/ME/.ssh/known_hosts). |
This was happening everytime I was using git under cygwin and very quickly the situation became completely unsustainable. But after doing a little research, I found a solution that is pretty simple:
passwd
file, which is usually at C:\cygwin\etc\
/home/ME
to read /cygdrive/c/path/to/home/folder/ME
or wherever your home
folder is.Expect to see the authenticity check one final time and see the ssh client
actually be able to write to the known_hosts
file.