Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

it must be 2 am in the morning... and ive had zero sleep. Nonetheless... I am trying to get my developer to send me a public ssh key. If the guy sends you a file that begins with:


Is a pem cert, correct, not a public key? :) Should i email back to say recreate?
Thanks! )

share|improve this question
was expecting something along the lines of : cat .ssh/ ssh-dss AAAAB3NzaC1kc3MAAACBAKVifmgpyGYg8OteHL2d1uzlW4CU3CJxVW91aNl70aeMfTW/7cMCi+1ZYsTi‌​gaKClchVN3fcOPNyo4EGQ0Elq40JolgxFvuHBmfOlJZGBrSrzm2DCpnd2JvEkgXjHGayCCpVRfKDuB+Ax‌​a30ct2VmZbBeZd3hW25yhlz1HDqjQ3xAAAAFQDLYUqSv1nSxEw9EqQn9G++FD6VxwAAAIEAkjFxCj9+ra‌​6movzxu/+h2HYkFsbO/4dOWS/HJ2z64y9ZDtPy2td+/88A46QqKI+rGZGH6OPn58X2wPGmhwyuMKPV0I5‌​ymBxWcPjI= member@rampage – CMag Oct 23 '12 at 6:21
is this a typo on the dev side? :)hehe – CMag Oct 23 '12 at 6:21
Clustermagnet, you might want to go back and review your existing stock of questions; there are quite a lot of them with valid answers, none of which have been aceepted. 67%'s not a terrible accept rate, but if you could improve it, that'd be much appreciated. – MadHatter Oct 23 '12 at 6:35
up vote 4 down vote accepted

That is an x509 certificate. Since a certificate contains a public key, and an SSH key is just a public key, it is possible to convert that into the OpenSSH key format. It's fairly uncommon to distribute keys like that however, so the developer may have sent you the wrong thing. To try to convert it use something like the following though:

% head -n2 test.crt
% openssl x509 -in test.crt -pubkey -noout >
% ssh-keygen -i -m PKCS8 -f
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtpZDQLOzXwlhLWvjquDzfE0hwtUjD1jQCfv5pcuPGfI918d+nKufDbnjCB1mmg2PTZb+PcVv2zeqnvBEISJh6idnOoQSZgx/gkS1VEkOJtaG+ECMUwW4/hiUbGlVkKaIhuy9eyoLdF/pJRE5ZNGNxSxwT/3111gxcZqc8VF1n6w==

Edit: It looks like the import feature from PKCS8 was added somewhere between 5.5p1 and 5.8p1, if your ssh-keygen doesn't have the -m option you'll need to find a later version.

share|improve this answer
thanks! illegal option -m though... – CMag Oct 23 '12 at 6:29
@Clustermagnet I think you'll need to find a more recent version of ssh-keygen (details in answer). – mgorven Oct 23 '12 at 6:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.