KB Article #160627

Convert public keys from SSH2 to format acceptable by OpenSSH

Problem

SecureTransport generates SSH public keys in SSH2 format. How can I transform them in a format acceptable by OpenSSH?

Resolution

To convert the public key from SSH2 to OPENSSH format, follow these instructions:
- Navigate to the OS level of a Unix system
- Make sure there is no “ ~/.ssh/rsa_ssh2.pub “ file ( ~ represents the user home folder)
- Make sure there is no “ ~/.ssh/rsa_openssh.pub “ file
- On your workstation open with a text editor the public key and copy it
- On the Unix system “ vi ~/.ssh/rsa_ssh2.pub ” and paste the contents in the file
- On the Unix system execute “ ssh-keygen -i -f ~/.ssh/rsa_ssh2.pub > ~/.ssh/rsa_openssh.pub ”
- On the Unix system “ vi ~/.ssh/rsa_openssh.pub ”

The output would be the converted public key.