SSH key conversion

From PrgmrWiki

OpenSSH has a special format of public key for public key authentication that is not according to rfc 4716. Because PuTTY and other software create the rfc 4716 format keys, it is necessary to convert them to the openssh format to be used to login to an openssh server. The ssh-keygen program with openssh will do this with the -i option, according to the manpage:

"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."

It could be used like

[root@bull bin]# ssh-keygen -i >> /home/user/.ssh/authorized_keys
Enter file in which the key is (/root/.ssh/id_rsa): /tmp/key

don't forget to edit /home/user/.ssh/authorized_keys and remove the carriage return