Thursday, February 14, 2013

OpenSSH and SSH2


SSH2, an improvement over SSH1, is a commercial version(as it contains patented technologies) and is not available for free downloads. SSH1, though it had patented technologies, it was available for free download. SSH Communications Security is the firm which owns the license for SSH2.

OpenSSH, is an open source initiative, which provides the same functionality as SSH2 without conflicting with any intellectual property restrictions. It is an offshoot of the OpenBSD project and is available for free download from www.openssh.org.

The commercial version of SSH2 uses a different key format than the OpenSSH. Let us see how their public key(.pub) format looks like

SSH2 public key ( one or multiple lines shall be used )


---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20111008"
AAAAB3NzaC1yc2EAAAABJQAAAIBjiKr/s/fetTIyUj6dBVRCwTPp+GTvH1mw42My
cBkQVjGXmo6znSIRgFdqUGNviDG+VH0NOcZN1dL96aakk7eQxzZtOYb0hMSeP1U+
K8IHfj+leALPgILC6T1PvO6F4sVRVySvQw5di9KCNrdK9KQtL93ZZfybzNPzBTVy
YBo4bQ==
---- END SSH2 PUBLIC KEY ----

OpenSSH public key ( all in one line )

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBjiKr/s/fetTIyUj6dBVRCwTPp+GTvH1mw42MycBkQVjGXmo6znSIRgFdqUGNviDG+VH0NOcZN1dL96aakk7eQxzZtOYb0hMSeP1U+K8IHfj+leALPgILC6T1PvO6F4sVRVySvQw5di9KCNrdK9KQtL93ZZfybzNPzBTVyYBo4bQ==


Conversion between SSH2 and OpenSSH public key formats


By using OpenSSH version of ssh-keygen, we can convert a public key between SSH2 and OpenSSH formats.

Run the following in system running OpenSSH

Convert SSH2 key to OpenSSH key

ssh-keygen -i -f ssh2.pub > openssh.pub

Convert OpenSSH key to SSH2 key

ssh-keygen -e -f openssh.pub > ssh2.pub



No comments:

Post a Comment