Posted: 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:
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?
Posted: 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.
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.
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