<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Univers Libre - openssh</title>
    <subtitle>Yet another sysadmin&#39;s personal blog</subtitle>
    <link rel="self" type="application/atom+xml" href="https://univers-libre.net/tags/openssh/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://univers-libre.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2017-09-06T21:46:24+00:00</updated>
    <id>https://univers-libre.net/tags/openssh/atom.xml</id>
    <entry xml:lang="en">
        <title>Convert SSH keys from a format to another</title>
        <published>2017-09-06T21:46:24+00:00</published>
        <updated>2017-09-06T21:46:24+00:00</updated>
        
        <author>
          <name>Romain</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://univers-libre.net/posts/convert-ssh-keys/"/>
        <id>https://univers-libre.net/posts/convert-ssh-keys/</id>
        
        <content type="html" xml:base="https://univers-libre.net/posts/convert-ssh-keys/">&lt;p&gt;An SSH key can be stored in multiple format. &lt;code&gt;ssh-keygen&lt;/code&gt; from OpenSSH
generates keys in its own format, but other SSH implementations can use other
formats. PuTTY for example generates keys in RFC4716 format, which looks like
this:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-----BEGIN RSA PUBLIC KEY-----&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;MIIBCgK349HFUE929fXGEvWmegnBGSuS+rU9soUg2FnODva32D1AqhwdziwHINFa&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;D1MVlcrYG6XRKfkcIFEO929JFNEJONBSEVCgJjtHAGZIm5GL/KA86KDp/CwDFMSw&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;luowcXwDwoyinmeOY9eKyh6aY72xJh7noLBBq1N0bWi1e2i+83txOCg4yV2oVXhB&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;o8pYEJ8LT3el6Smxol3C1oFMVdwPgc0vTl25XucMcG/ALE/KNY6pqC2AQ6R2ERlV&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gPiUWOPatVkt7+Bs3h5Ramxh7XjBOXeulmCpGSynXNcpZ/06+vofGi/2MlpQZNhH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Ao8eayMp6FcvNucIpUndo1X8dKMv3Y26ZQIDAQAB&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-----END RSA PUBLIC KEY-----&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can’t simply copy-paste this in an &lt;em&gt;authorized_keys&lt;/em&gt; file. Hopefully you
can easily convert the public key from a format to another. This is done by
I-do-about-anything-and-everything command, aka &lt;code&gt;ssh-keygen&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ ssh-keygen -i -m &amp;lt;format&amp;gt; -f input_key.pub &amp;gt; output_key.pub&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;-m&lt;/code&gt; specify the input key format among &lt;em&gt;RFC4716&lt;/em&gt; (the format used by PuTTY, this
is the default if &lt;code&gt;-m&lt;/code&gt; isn’t specified), &lt;em&gt;PKCS8&lt;/em&gt; and &lt;em&gt;PEM&lt;/em&gt;.&lt;/p&gt;
</content>
        
    </entry>
</feed>
