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 have a box I'm trying to create an SSH tunnel to using a keypair without a password. If I run cygwin.exe and generate a keypair without a password using ssh-keygen and put the public key on the server I can use ssh to create a tunnel between the 2 boxes no problem.

My question though is this. Can I do this without having to run cygwin.bat and use ssh.exe directly from a command prompt.

When I try this I am prompted for the user's password and it is not using the keypair. I'm assuming that when I run cygwin.exe it is loading up my usr directory and using the keypair from the .ssh directory and when I run ssh.exe directly it is not loading my usr directory and therefore it is not trying to use the keypair and is prompting me for my password.

How do I solve this problem?

share|improve this question

ssh looks in $HOME/.ssh/id_* for your keys, so you can set the HOME environment variable.

In cmd.exe:

set HOME=path\to\your\home

(I'm not sure about where Cygwin puts your homedir, but set HOME=%USERPROFILE% should work.)

share|improve this answer
    
Thanks, will test it out and let you know. – J.r. Hounddog Jun 3 '11 at 14:04

You must log in to answer this question.

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