Converting Public Key from SSH2 to OpenSSH

Networking/Security Forums -> Cryptographic Software and Hardware

Author: rawbone72 PostPosted: Fri Jun 18, 2010 12:24 am    Post subject: Converting Public Key from SSH2 to OpenSSH
    ----
Hello,

I have a question. I have someone who has provided me an SSH2 public key and is trying to connect to my Ubuntu 9.x SFTP server using public/private key authentication as opposed to username/password. Since it appears the default server on my Ubuntu system is an "OpenSSH SSH daemon", it has been suggested I convert the SSH2 public key to OpenSSH format, so I found this documentation and followed it:

http://burnz.wordpress.com/2007/12/14/ssh-convert-openssh-to-ssh2-and-vise-versa/

And so I ran the following command on my system, where pvisrep01.pub is the SSH2 public key that was provided.

ssh-keygen -i -f pvisrep01.pub > pvisrep01_openssh.pub

Thing is, the contents of pvisrep01_openssh.pub look very similar to the original SSH2 file - the first 10 and last 10 characters match exactly, and I wonder if this is normal or if I am not doing the conversion properly.

Also, does OpenSSH daemon not accommodate connections using SSH2 keys? When I test the connection using a WinSCP client, my settings indicate the protocol being used is "SSH protocol version 2"; and I can connect fine using the public key. Is a "conversion" even necessary then?

Could anyone help clear up my confusion, maybe suggest whether my approach sounds correct or not?

Thank you,

-Robin

Author: Timid PostPosted: Mon Jul 19, 2010 6:04 am    Post subject: Re: Converting Public Key from SSH2 to OpenSSH
    ----
Quote:
Thing is, the contents of pvisrep01_openssh.pub look very similar to the original SSH2 file - the first 10 and last 10 characters match exactly, and I wonder if this is normal or if I am not doing the conversion properly.

Also, does OpenSSH daemon not accommodate connections using SSH2 keys? When I test the connection using a WinSCP client, my settings indicate the protocol being used is "SSH protocol version 2"; and I can connect fine using the public key. Is a "conversion" even necessary then?


man ssh-keygen
Code:
     -i      This option will read an unencrypted private (or public) key file
             in SSH2-compatible format and print an OpenSSH compatible private
             (or public) key to stdout.  ssh-keygen also reads the RFC 4716
             SSH Public Key File Format.  This option allows importing keys
             from several commercial SSH implementations.


Quote:
Is a "conversion" even necessary then?

yes, probably.

-Batman

Moderator note: edited to fix quotes - capi

Author: lawrencehaydenLocation: california PostPosted: Tue Sep 25, 2012 2:58 pm    Post subject:
    ----
Convert OpenSSH key to SSH2 key
1. Run the OpenSSH version of ssh-keygen on your OpenSSH public key to convert it into the format needed by SSH2 on the remote machine. This must be done on the system running OpenSSH.
#ssh-keygen -e -f ~/.ssh/id_dsa.pub > ~/.ssh/id_dsa_ssh2.pub

Convert SSH2 key to OpenSSH key
2. Run the OpenSSH version of ssh-keygen on your ssh2 public key to convert it into the format needed by OpenSSH. This needs to be done on the system running OpenSSH.
#ssh-keygen -i -f ~/.ssh/id_dsa_1024_a.pub > ~/.ssh/id_dsa_1024_a_openssh.pub
ormation much.



Networking/Security Forums -> Cryptographic Software and Hardware


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group