• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Converting Public Key from SSH2 to OpenSSH

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Cryptographic Software and Hardware

View previous topic :: View next topic  
Author Message
rawbone72
Just Arrived
Just Arrived


Joined: 23 Apr 2010
Posts: 0


Offline

PostPosted: Fri Jun 18, 2010 12:24 am    Post subject: Converting Public Key from SSH2 to OpenSSH Reply with quote

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
Back to top
View user's profile Send private message
Timid
Just Arrived
Just Arrived


Joined: 19 Jul 2010
Posts: 0


Offline

PostPosted: Mon Jul 19, 2010 6:04 am    Post subject: Re: Converting Public Key from SSH2 to OpenSSH Reply with quote

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
Back to top
View user's profile Send private message
lawrencehayden
Just Arrived
Just Arrived


Joined: 25 Sep 2012
Posts: 3
Location: california

Offline

PostPosted: Tue Sep 25, 2012 2:58 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Cryptographic Software and Hardware All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register