I'm using Win XP and I'm trying to connect by SSH to remote host using RSA key.

I've investigated that cygWin recognizes Documents and Settings dir as home directory

Z:\app\cwRsync\bin>cygpath -H
/cygdrive/c/Documents and Settings

I've created .ssh directory in Documents and Settings/user/.ssh and moved known_hosts, id_rsa, id_rsa.pub there.

Now, I'm trying to connect via ssh.exe to remote host

Z:\app\cwRsync\bin>ssh -p 22 myuser@remotehost.com
Could not create directory '/home/user/.ssh'.
The authenticity of host '[remotehost.com]:22 ([remotehost.com]:22)' can't be established.
RSA key fingerprint is f7:f4:2c:e0:c6:7e:d2:a4:45:70:63:df:bf:f2:84:46.
Are you sure you want to continue connecting (yes/no)?

What I'm doing wrong? Why ssh.exe couldn't create directory /home/user/.ssh?

Thank you.

link|improve this question

67% accept rate
you have defined the HOME variable with the correct path? or maybe u need to mount /home to the correct directory, have past some time since I used cygwin – Aragorn Apr 25 at 23:21
feedback

3 Answers

It can't create it because it's already been created. I'd suspect a permissions issue. What are the permissions on ~, ~/.ssh and the files within ~/.ssh?

link|improve this answer
I've changed permissions to 777, drwxr-xr-x 1 user mkgroup 0 Mar 30 16:01 Documents and Settings |||||||||| drwxr-xr-x 1 user mkgroup 0 Mar 30 16:01 user |||||||||| There is neither .ssh file in Documents and Settings/user/ nor in Documents and Settings/ – Kirzilla Mar 30 '10 at 12:05
Is there any ways to tell ssh.exe to look for keys not in .ssh directory, but in another one? – Kirzilla Mar 30 '10 at 12:17
In your question, you said that you created a .ssh directory, but in your comment you say it's not there. Also, to be clear, in your question you say "I've created .ssh directory in Documents and Settings/user/.ssh". Does that mean a directory ".ssh" within another directory ".ssh"? If so, the files need to be in /cygdrive/c/Documents and Settings/.ssh not in a directory below that. There shouldn't be any file called ".ssh" only a directory with that name. – Dennis Williamson Mar 30 '10 at 13:42
feedback

Try changing the permissions on .ssh to 700. This is because .ssh is a sensitive directory where private keys are stored.

Another thing to try would be ln -s /cygdrive/c/Documents\ and\ Settings /home, thus causing searches in /home to be redirected to Documents and Settings.

link|improve this answer
feedback

In your Documents and Settings folder of your local machine, create the folder home\<user>. 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\<user>.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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