Re: How can Putty load my public key generated with OpenSSH

dkoleary_at_attbi.com
Date: 10/23/03


Date: Thu, 23 Oct 2003 13:24:58 GMT

Ralph <rgreen@preferredstaff.net> wrote:

> Your suggestion here would not help, but it gave me a clue to get
> closer. I am trying to get the keys I generated with OpenSSH to work
> with Putty. Seeing that ssh-keygen has an import option, I looked and
> sure enough there is an export option -e. So, I took my id_rsa file,
> and exported it to standard SSH2 format. I copied that to the Windows
> machine, where I ran puttygen and did a conversion on the key. That
> produced a fle that Putty will load as a key file. I tried to connect
> and Putty just exits. Looking in the log on the server machine, I see
> a message about no authentication methods being able to be negotiated.
> I have progressed a bit, but I'll keep looking. Incidentally, I took
> this private key to another Linux machine and used it to connect right
> away. So, my keys should be OK.

I didn't make myself clear. Let me take a large step back and go over
the basics. Sorry if this is overkill, but it's helpful to be
speaking from the same page.

Taking putty out of the picture, for the moment, let's say you have
two linux boxes: A and B. A is running the sshd daemon and allows
publick key authentication and passwords. B simply has openssh running
but no daemon running.

In order to connect and open a shell on A from B, a user on B can simply
execute "ssh A", enter a password and connect right in. If the user
on B wants to use public key authentication, he must do the following:

1. Create a key pair on B
2. Copy the public key to A
3. Update the A:~/.ssh/authorized_keys2 file

There are a number of failure points that I glossed over, but those
are the configuration steps.

A user on A then attempts to connect to B; the connection fails because
there is no ssh daemon running on B given the scenario above.

Getting back to your situation, putty is a ssh client - not an ssh
server (unless there's something about putty that I'm not aware of -
certainly a possibility). There is no way that I know of for someone
on your linux box to connect to putty on your windows system.
Therefore, there should be no reason to generate the keys on the linux
box to be used in putty.

Putty has its own key generation facility. In fact, it even has
it's own ssh-agent program that can be put in the startup. The
recommended and supported method of generating keys on putty to
be used with an openssh server is as follows:

1. On the putty system, execute puttygen.exe; follow the prompts to
generate the keys.

2. Execute pagent.exe. Right click the icon in the lower right,
select "add key", then navigate to where you stored your key pair.
When you open the key, it will ask for the passphrase that you supplied
above.

3. Copy the public key portion to the openssh server using either
winscp, or ftp.

4. Connect to the openssh server and execute

"ssh-keygen -i -f ${public} >> ~/.ssh/authorized_keys2"

>From this point, assuming you have all the permissions set correctly,
you will be able to execute

putty.exe -ssh -2 -X ${user}@${host}

to connect right in w/o supplying a password.

Hope that clears things up.

Doug

-- 
--------
Senior UNIX Admin
O'Leary Computer Enterprises
dkoleary@attbi.com (w) 630-904-6098 (c) 630-248-2749
resume:  http://home.attbi.com/~dkoleary/resume.html


Relevant Pages

  • Re: AIX patch works for Openssh but not Putty
    ... >>I have applied a patch to openssh to get it working with AIX password ... If I ssh to the daemon using openssh ssh it works fine. ... > As far as I know PuTTY does not handle PASSWD_CHANGEREQ. ...
    (comp.security.ssh)
  • Re: Putty psftp connection problem...
    ... After sifting through the openssh code, it seems when ssh v2 is used ... with compression, a never ending loop requesting memory occurs. ... the putty psftp breaks as soon as I turn on priv-sep (which is ...
    (comp.security.ssh)
  • Re: ssh v2 public key identification works and works not
    ... >>Connecting to A from Dor B using ssh v2 and public ... > Well, if you were to _tell_ us what PuTTY is doing, we might be able ... > get public key authentication wrong in all of those situations. ... > key format as OpenSSH, so you can't just reuse the same key file? ...
    (comp.security.ssh)
  • Re: openssh + putty interoperability
    ... > OpenSSH to a combination of Dropbear (presumably server) and PuTTY ... > (presumably client); so where does OpenSSH come into the question? ...
    (comp.security.ssh)
  • Re: Putty psftp connection problem...
    ... here is the original message I sent to the openssh and putty ... A customer of mine reported that sftp didn't work for them. ... On the unix system the sshd reports the ...
    (comp.security.ssh)