Unable to log in to SSH Server using Cygwin
Larry Hall (Cygwin)
Mon Feb 4 16:12:00 GMT 2013
On 2/4/2013 4:13 AM, Jeffrey Cheng wrote:
> I've been trying to set up an SSH server in Cygwin and I haven't been
> able to successfully log in to the localhost. Following some online
> tutorials, I have set up a public/private key pair, ran
> ssh-host-config and then when attempting to log in, I get the below
> $ ssh -v -i ~/.ssh/id_dsa [user]@[hostname]
> OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012
> debug1: Reading configuration data /etc/ssh_config
> debug1: Connecting to [host] [host ip] port 22.
> debug1: Connection established.
> debug1: identity file /home/[user]/.ssh/id_dsa type 2
> debug1: identity file /home/[user]/.ssh/id_dsa-cert type -1
> debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1
> debug1: match: OpenSSH_6.1 pat OpenSSH*
> debug1: Enabling compatibility mode for protocol 2.0
> debug1: Local version string SSH-2.0-OpenSSH_6.1
> debug1: SSH2_MSG_KEXINIT sent
> debug1: SSH2_MSG_KEXINIT received
> debug1: kex: server->client aes128-ctr hmac-md5 none
> debug1: kex: client->server aes128-ctr hmac-md5 none
> debug1: sending SSH2_MSG_KEX_ECDH_INIT
> debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
> debug1: Server host key: ECDSA f4:15:10:b9:7e:8e:61:a4:e8:b9:e4:4b:9b:98:cb:82
> debug1: Host '[host]' is known and matches the ECDSA host key.
> debug1: Found key in /home/[user]/.ssh/known_hosts:1
> debug1: ssh_ecdsa_verify: signature correct
> debug1: SSH2_MSG_NEWKEYS sent
> debug1: expecting SSH2_MSG_NEWKEYS
> debug1: SSH2_MSG_NEWKEYS received
> debug1: Roaming not allowed by server
> debug1: SSH2_MSG_SERVICE_REQUEST sent
> debug1: SSH2_MSG_SERVICE_ACCEPT received
> debug1: Authentications that can continue:
> debug1: Next authentication method: publickey
> debug1: Offering DSA public key: /home/[user]/.ssh/id_dsa
> Connection closed by [host ip]
> It seems that as soon as it tries to authenticate the private key, I
> get the "Connection closed" message. Has anyone experienced this and
> is aware of a solution?
> I'm running Cygwin 1.7.17 on Windows Server 2003. My Windows user
> account has administrative privileges.
> I've tried running ssh into this box from my local Windows PC and am
> actually able to use password authentication. However, I have a
> requirement that I muse use public key authentication. This at least
> tells me there shouldn't be any firewall issue.
> Any help in this matter would be appreciated.
If you can login with a password, then I agree that this sounds like
some kind of authentication problem. Without more detail, I can only
guess as to the cause. But the first thing I would say is to make
sure the user you log in as is a local user for the machine you're
trying to reach. Second, it's conspicuous that you didn't mention
ssh-user-config. You may just need to run that to generate the
proper keys for you to use. If that doesn't help, my next WAG is to
try setting up a RSA (rather than DSA) key. Both should work but RSA
is the more traditional route and may get you further.
If none of the above helps, I'd recommend checking out the openssh
README for Cygwin at /usr/share/doc/Cygwin/openssh.README. You could
also go back to the authors of the online tutorials you used to set
up your server, etc. Honestly, lots of what's out there is dated,
incomplete, or just plain wrong so you may find it more expedient to
start over than debug the process you followed. But if you would
rather debug, consult the source for further help.
If none of the above helps and you have things set up as described in
the Cygwin documentation, please follow the problem reporting guidelines
at the link below with any follow-up to this list. It will help bootstrap
> Problem reports: http://cygwin.com/problems.html
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin