<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Ssh on Kiril Vladimirov</title>
    <link>https://vld.bg/tags/ssh/</link>
    <description>Recent content in Ssh on Kiril Vladimirov</description>
    <generator>Hugo -- 0.168.0</generator>
    <language>en</language>
    <atom:link href="https://vld.bg/tags/ssh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Authorize SSH keys</title>
      <link>https://vld.bg/tips/ssh-keys/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://vld.bg/tips/ssh-keys/</guid>
      <description>&lt;p&gt;How often have you asked or have been asked to provide public SSH keys in order
to get authorized into given server or Git repository? I&amp;rsquo;ve heard horror
stories of people providing private keys, by mistake. GitHub and GitLab ease
this process greatly, but are not advertising it well enough.&lt;/p&gt;
&lt;p&gt;You can append &lt;code&gt;.keys&lt;/code&gt; to the URL of your profile in order to receive the
public keys you have on your account in a format to directly pipe it into
&lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>How often have you asked or have been asked to provide public SSH keys in order
to get authorized into given server or Git repository? I&rsquo;ve heard horror
stories of people providing private keys, by mistake. GitHub and GitLab ease
this process greatly, but are not advertising it well enough.</p>
<p>You can append <code>.keys</code> to the URL of your profile in order to receive the
public keys you have on your account in a format to directly pipe it into
<code>~/.ssh/authorized_keys</code>:</p>
<pre tabindex="0"><code>curl https://github.com/&lt;username&gt;.keys | tee -a ~/.ssh/authorized_keys
</code></pre><p>Same goes for any GitLab instance.</p>
]]></content:encoded>
    </item>
    <item>
      <title>SSH into an ancient machine</title>
      <link>https://vld.bg/tips/anctient-ssh/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://vld.bg/tips/anctient-ssh/</guid>
      <description>&lt;p&gt;TL;DR: &lt;code&gt;ssh -oHostKeyAlgorithms=+ssh-rsa -oRequiredRSASize=1024 &amp;lt;user&amp;gt;@&amp;lt;host&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Have you ever tried to SSH into an old machine, say a managed switch, UPS or
router from the previous decade only to get declined with the following error:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#d0d0d0;background-color:#202020;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Unable to negotiate with &amp;lt;host&amp;gt;: no matching host key type found.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Their offer: ssh-rsa,ssh-dss
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s frustrating, isn&amp;rsquo;t it?  OpenSSH implements all of the cryptographic
algorithms needed for compatibility with standards-compliant SSH
implementations, but since some of the older algorithms have been found to be
weak, not all of them are enabled by default. If you want to learn more about
it, definitely should read
&lt;a href=&#34;https://www.openssh.com/legacy.html&#34; target=&#34;_blank&#34;&gt;OpenSSH Legacy Options&lt;/a&gt;
.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>TL;DR: <code>ssh -oHostKeyAlgorithms=+ssh-rsa -oRequiredRSASize=1024 &lt;user&gt;@&lt;host&gt;</code></p>
<p>Have you ever tried to SSH into an old machine, say a managed switch, UPS or
router from the previous decade only to get declined with the following error:</p>
<div class="highlight"><pre tabindex="0" style="color:#d0d0d0;background-color:#202020;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-txt" data-lang="txt"><span style="display:flex;"><span>Unable to negotiate with &lt;host&gt;: no matching host key type found.
</span></span><span style="display:flex;"><span>Their offer: ssh-rsa,ssh-dss
</span></span></code></pre></div><p>It&rsquo;s frustrating, isn&rsquo;t it?  OpenSSH implements all of the cryptographic
algorithms needed for compatibility with standards-compliant SSH
implementations, but since some of the older algorithms have been found to be
weak, not all of them are enabled by default. If you want to learn more about
it, definitely should read
<a href="https://www.openssh.com/legacy.html" target="_blank">OpenSSH Legacy Options</a>
.</p>
<p>But this is a tip, so the short story is that you should use one of offered
algorithms by the server, say <code>-oHostKeyAlgorithms=+ssh-rsa</code>. When it comes to
ssh-rsa, however that won&rsquo;t be enough and you would be challenged with another
error:</p>
<div class="highlight"><pre tabindex="0" style="color:#d0d0d0;background-color:#202020;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-txt" data-lang="txt"><span style="display:flex;"><span>Bad server host key: Invalid key length
</span></span></code></pre></div><p>The crypto-policy that comes with modern distributions does not allow RSA key
sizes &lt; 2048 bit. Some SSH servers are configured with 1024-bit key sizes that
can lead to connection failures. <code>-oRequiredRSASize=1024</code> overrides that
default and Voilà.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
