Super User is a question and answer site for computer enthusiasts and power users. 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

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.

share|improve this question

migrated from stackoverflow.com Dec 11 '12 at 0:23

This question came from our site for professional and enthusiast programmers.

2  
This might need to be moved to superuser. – VoronoiPotato Dec 10 '12 at 13:14
1  
" Are you sure you want to continue connecting (yes/no)? no Host key verification failed" There's a surprise. – barlop Dec 11 '12 at 0:26
    
I have typed yes, the no was just to get an example error message. (hint: it's the same one.) – Craig Cuthbertson Dec 12 '12 at 12:08

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

share|improve this answer
2  
Yup, 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 Apr 24 '14 at 14:22
    
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 Oct 12 '15 at 19:21

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

share|improve this answer
    
.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 Dec 12 '12 at 12:03

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

share|improve this answer
    
I have done so. The 'no' was to reproduce the error message to post on here. – Craig Cuthbertson Dec 12 '12 at 12:08

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

share|improve this answer
    
This did indeed create a passwd file, but sadly nowhere was I referencing home – Jamie Hutber Feb 22 at 17:27

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

share|improve this answer

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

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .