Using ssh on cygwin fails with no error, but not from DOS or OSX

-1

I'm using cygwin on WinXP to connect via ssh to a linux system. The remote linux system consists of three virtual machines (VM) running in VirtualBox. The RSA key is different for each VM even though the IP is the same. When I try and connect via ssh from cygwin, the command waits 30 to 40 seconds, then drops back to the prompt with no error messages. From either DOS or OSX, it connects no problem. I would have expected a .ssh directory where I could poke around the known_hosts file, or just delete it and start new, but it's not there. At some point in the past, I could connect, but have no idea what sequence of actions I took to break it.

Is there some directory or file where I can reset ssh?

dacracot

Posted 2009-10-05T14:48:59.470

Reputation: 323

what do you mean from DOS, how are you doing ssh from DOS, how are you doing DOS (if you even mean DOS) – barlop – 2015-04-13T11:50:10.467

What if you just type the password during those 30..40 seconds? – Arjan – 2009-10-05T17:30:16.843

Answers

2

Cygwin's ssh does create a .ssh directory. If I recall correctly, your home directory is set to be C:\Documents and Settings\username. The .ssh directory should be under there. It's probably easier to just ask the shell to take you to your home directory using cd ~. From your cygwin prompt:

$ cd ~/.ssh
$ ls -a

You should find your known_hosts file in there.

To diagnose further, add one or more -v options to the command line:

$ ssh -v otherhost
$ ssh -vv otherhost

You'll get more output with each additional -v (up to 3).

Doug Harris

Posted 2009-10-05T14:48:59.470

Reputation: 23 578

You write "Cygwin's ssh does create a .ssh directory" <--- Maybe Cygwin ssh might not necessarily create .ssh by default, though always trivial to mkdir it. Though I note that in your test it did. – barlop – 2015-04-13T11:52:35.710

You write "If I recall correctly, your home directory is set to be C:\Documents and Settings*username*. The .ssh directory should be under there" <----- Nope. or at least not necessarily. I am on an XP machine right now and I see c:\cygwin\home\username And any .ssh would be within that. c:\cygwin\home\username.ssh I've never had it anywhere else. For Win7 too. c:\cygwin\home.... – barlop – 2015-04-13T11:53:12.317

You write "Cygwin's ssh does create a .ssh directory" <--- Maybe Cygwin ssh might not necessarily create .ssh by default, though always trivial to mkdir it. Though I note that in your test it did. And I think ssh can run fine without the directory so I don't think it's relevant particularly if he has no .ssh directory and no known_hosts file – barlop – 2015-04-13T11:58:20.133

The .ssh directory does not exist. – dacracot – 2009-10-05T15:07:35.790

maybe cygwin doesn't have access to write to the directory – Roy Rico – 2009-10-05T18:17:15.407

Can you show the value of $HOME here? I did a clean install of cygwin in a VM, launched rxvt (non-X version) and my $HOME directory didn't exist. When I ran Cygwin.bat, my $HOME did exist. When I ran ssh, it created ~/.ssh – Doug Harris – 2009-10-05T19:07:36.007

I think newer cygwin installs point /home to C:\Documents and Settings, but older installs would put it under the cygwin root directory. If you installed cygwin to C:\cygwin, it would be C:\cygwin\home. – quack quixote – 2009-10-05T22:07:18.843

0

Install the findutils package in Cygwin and run updatedb, then type "locate known_hosts".

CarlF

Posted 2009-10-05T14:48:59.470

Reputation: 8 576