Cygwin cannot create .ssh

3

I'm having some trouble using Git with cygwin.

"Could not create directory '/home/Craig/.ssh'. The authenticity of host 'github.com (207.97.227.239)' 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)? no Host key verification failed. fatal: The remote end hung up unexpectedly"

is being displayed whilst trying to connect to github using SSH. I've also tried using https:// as the remote path but to no success.

I'm running windows 7.

Craig Cuthbertson

Posted 2012-12-10T13:01:45.547

Reputation: 31

2This might need to be moved to superuser. – VoronoiPotato – 2012-12-10T13:14:39.937

1" Are you sure you want to continue connecting (yes/no)? no Host key verification failed" There's a surprise. – barlop – 2012-12-11T00:26:15.370

I have typed yes, the no was just to get an example error message. (hint: it's the same one.) – Craig Cuthbertson – 2012-12-12T12:08:01.687

Answers

6

This worked for me!
http://ekawas.blogspot.co.uk/2007/03/solving-pesky-ssh-issues-in-cygwin.html

First, locate the file called 'passwd' in your C:\path\to\cygwin\etc directory and open it with wordpad.

Second, replace the text
/home/YOUR_NAME
with
/cygdrive/c/Documents and Settings/YOUR_NAME

diannaL

Posted 2012-12-10T13:01:45.547

Reputation: 61

I changed how Cygwin mounts the C drive so it's at /c/ instead of /cygdrive/c/ and I got the same issue as this question and this answer fixed it (of course, I changed it to /c/Users/YOUR_NAME because of what I just said and I am on Windows 7 (which has C:\Users instead of C:\Documents and Settings it'd seem.)) – Captain Man – 2015-10-12T19:21:17.237

2Yup, this is one possible problem: if you have changed the cygwin home folder to point to the Windows home, it is not enough to just set the HOME env variable. The /etc/passwd file must also be edited, in order to point to your actual home folder. Git seems to rely on that (instead of first checking the $HOME var). Also remember that, starting on Windows 7, your home folder will be on /cygdrive/c/Users/YOUR_NAME instead of /cygdrive/c/Documents and Settings/YOUR_NAME. – rsenna – 2014-04-24T14:22:55.227

1

In addition to answer by diannal, if you don't have a passwd file under etc folder in Cygwin root folder, then you can first create one by issuing this command: mkpasswd -l -p "$(cygpath -H)" > /etc/passwd

Timo

Posted 2012-12-10T13:01:45.547

Reputation: 111

This did indeed create a passwd file, but sadly nowhere was I referencing home – Jamie Hutber – 2016-02-22T17:27:25.243

1

maybe the permissions to your home directory are interfering with ssh's ability to create the known_hosts file?

go to your home directory and create a folder called .ssh, and a blank file called known_hosts inside of it. then set the permissions on the file to 644.

cd ~
mkdir .ssh
touch ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts

then try ssh again and see if the result is any different. (note: you'll have to say yes when asked if you want to continue connecting the first time. then that server will be added to the known_hosts list and you shouldn't be prompted anymore after that.)

nullrevolution

Posted 2012-12-10T13:01:45.547

Reputation: 121

.ssh already exists in my home directory, I have created and chmod'd the known_hosts file, but to no positive effect.

My home dir is currently set as /cygdrive/c/Users/Craig, could this be the problem? – Craig Cuthbertson – 2012-12-12T12:03:41.770

1

Try typing yes when you are asked if you want to continue

Chronial

Posted 2012-12-10T13:01:45.547

Reputation: 86

I have done so. The 'no' was to reproduce the error message to post on here. – Craig Cuthbertson – 2012-12-12T12:08:34.260

0

In your Documents and Settings folder of your local machine, create the folder home\. For some reason, cwRsync won't create these folders for you. I didn't change my cygpath, so I created mine in C:\Program Files\cwRsync\home\.

Jamie Hutber

Posted 2012-12-10T13:01:45.547

Reputation: 323

0

Use Sysinternals Process Monitor to log the file system accesses that take place when you are trying to do this.

Dominic Cronin

Posted 2012-12-10T13:01:45.547

Reputation: 140