Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
1  
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 '12 at 23:21
    
@Kirzilla Accept Kevin M's answer! along with my comment it finally provided a working solution, which was nowhere else to be found. :< –  sjas Feb 28 '13 at 15:05
add comment

3 Answers

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.

share|improve this answer
    
The creation of the symbolic link via ln -s ... in /home, with the link being named like your personal user folder does indeed help!!! Afterwards the right folder can be found. After fixing the folder rights (recursively adding root group to .ssh folder.) I was good to go. THANK YOU! Sadly I can just upvote this once... –  sjas Feb 28 '13 at 15:03
add comment

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?

share|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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.