Using OpenSSH keys with an ssh.com server

You can determine which versions of the ssh protocol an ssh server supports by examining the service banner. The service banner includes both the remote protocol version and the remote software version.

Example:
telnet ssh_server 22

SSH-1.5-remote_software_version (supports ssh protocol 1 only)
SSH-1.99-remote_software_version (supports ssh protocols 1 and 2)
SSH-2.0-remote_software_version (supports ssh protocol 2 only)

ssh protocol 2:

1. Create a DSA or RSA key named foo. As of version 3.0 of the ssh.com server includes support for RSA keys.
$ cd ~/.ssh
$ ssh-keygen -t dsa -f foo

2. Convert the DSA or RSA key into "SECSH Public Key File Format," the format used on an ssh.com server.
$ ssh-keygen -e -f foo > foo.pub

3. Copy the foo.pub file to the ssh.com server.
$ scp foo.pub user@ssh.com_host:.ssh2

If the remote server only allows ssh protocol 2, you may receive the following errors:

scp: warning: Executing scp1 compatibility.
scp: FATAL: Executing ssh1 in compatibility mode failed (Check that scp1 is in your PATH).
lost connection

Use sftp instead to transfer the key:

$ sftp user@ssh.com_host
put foo.pub .ssh2

4. Add the appropriate ~/.ssh2/authorization file entry in the ssh.com server.
$ ssh user@ssh.com_host 'echo "key foo.pub" >> .ssh2/authorization'

5. Login to the ssh.com server using the foo identity.
$ ssh -o IdentityFile2=~/.ssh/foo user@ssh.com_host


ssh protocol 1:

1. Create an RSA1 key.
$ cd ~/.ssh
$ ssh-keygen -t rsa1

2. Append the ~/.ssh/identity.pub file to the ~/.ssh/authorized_keys file on the ssh.com server.
$ cat ~/.ssh/identity.pub | ssh remote_server "cat - >> ~/.ssh/authorized_keys"

Note: Any ssh.com server only allowing ssh protocol 1 should be upgraded, as usage of ssh protocol 1 itself is not recommended.

Back to brandonhutchinson.com.

Last modified: 2007/10/03