delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/01/21/15:35:42

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=2.6 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,KAM_THEBAT
X-Spam-Check-By: sourceware.org
Date: Sun, 22 Jan 2012 00:34:55 +0400
From: Andrey Repin <anrdaemon AT freemail DOT ru>
Reply-To: Andrey Repin <cygwin AT cygwin DOT com>
Message-ID: <1326199340.20120122003455@mtu-net.ru>
To: Andrew DeFaria <Andrew AT DeFaria DOT com>, cygwin AT cygwin DOT com
Subject: Re: Putty and pre-shared keys with Cygwin's sshd
In-Reply-To: <jff23g$h5j$1@dough.gmane.org>
References: <jfcsbt$eci$1 AT dough DOT gmane DOT org> <1910391597 DOT 20120121163937 AT mtu-net DOT ru> <jff23g$h5j$1 AT dough DOT gmane DOT org>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Greetings, Andrew DeFaria!

>> What key type you generate? How do you save both parts of the key? You
>> said you copied public key, did you saved private key as well? Or you 
>> just assumed it was saved somewhere automatically? -- WBR, Andrey 
>> Repin (anrdaemon AT freemail DOT ru) 21.01.2012, <16:36> Sorry for my 
>> terrible english... 
> OK, here's what I did now:

>   * Regenerated a SSH-2 DSA key 1024 bit
>   * Saved the public and private keys
>   * Copied the public key from the box in puttygen that says "Public key
>     for the pasting into authorized-keys file" and pasted it into my
>     machine's ~/.ssh/authorized_keys
>   * Ran putty on the remote machine and made sure to point the
>     Connection: SSH: Auth pointed to the private key I saved from
>     puttygen (a .ppk file).

> Attempted to connect with that and I got:

> Using username "adefaria"
> Server refused our key
> adefaria AT ltsdo-adefaria's password:

> What did I do wrong?

Ok, now we're talking. There's indeed a tricky part involved, let me try to
cover it for you.
On puttygen part, it seems you did it right. (Though, saving public key part is
only required for ssh servers compliant with RFC4716.)
On connection part... seems like you've supplied the right login name...
On server part...
First. Make sure your ssh server is configured to allow DSA keys. RSA keys are
more common, as I've discovered. And sometimes servers configured to disallow
DSA key authentication, even if they are offering DSA key themselves.
Second, double-check server log for reason to refuse the key. The top (IMO)
reason to refuse key authentication is wrong access mask on ~/.ssh/authorized_keys
file. It must not be group- or world-writable.


--
WBR,
Andrey Repin (anrdaemon AT freemail DOT ru) 22.01.2012, <00:18>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019