<?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>Openssh on inetshell</title><link>https://inet.sh/en/tags/openssh/</link><description>Recent content in Openssh on inetshell</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 25 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://inet.sh/en/tags/openssh/index.xml" rel="self" type="application/rss+xml"/><item><title>SSH: "no matching host key type found. Their offer: ssh-rsa" (and ssh-dss)</title><link>https://inet.sh/en/posts/linux/ssh-no-matching-host-key-type-found/</link><pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate><guid>https://inet.sh/en/posts/linux/ssh-no-matching-host-key-type-found/</guid><description>SSH into old gear (iLO, routers, NAS, Windows 2003) when OpenSSH says &amp;#39;no matching host key type found. Their offer: ssh-rsa&amp;#39; or ssh-dss: HostKeyAlgorithms, PubkeyAcceptedAlgorithms, KexAlgorithms, Ciphers, and what to do now that ssh-dss is gone from OpenSSH 10.</description><content:encoded><![CDATA[<h2 id="tldr">TL;DR</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">ssh -o <span class="nv">HostKeyAlgorithms</span><span class="o">=</span>+ssh-rsa -o <span class="nv">PubkeyAcceptedAlgorithms</span><span class="o">=</span>+ssh-rsa admin@legacy-host
</span></span></code></pre></td></tr></table>
</div>
</div><p>To make it stick, a block in <code>~/.ssh/config</code> <strong>for that host only</strong>:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Host legacy-host
</span></span><span class="line"><span class="cl">    HostKeyAlgorithms +ssh-rsa
</span></span><span class="line"><span class="cl">    PubkeyAcceptedAlgorithms +ssh-rsa
</span></span></code></pre></td></tr></table>
</div>
</div><p>If the offer is <code>ssh-dss</code>, the option is <code>+ssh-dss</code>, but it <strong>only works on OpenSSH older than 10.0</strong>. Since 10.0 (April 2025) DSA no longer exists in the client and <code>+ssh-dss</code> fails with <code>Bad key types</code>; you need an older client (<a href="/en/posts/linux/ssh-no-matching-host-key-type-found/#ssh-dss-on-openssh-10-or-newer">below</a>).</p>
<h2 id="what-the-error-means">What the error means</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Unable to negotiate with 192.168.1.10 port 22: no matching host key type found. Their offer: ssh-rsa
</span></span></code></pre></td></tr></table>
</div>
</div><p>The server can only sign its host key with <strong><code>ssh-rsa</code></strong>, which is RSA over <strong>SHA-1</strong>. OpenSSH 8.8 (September 2021) stopped accepting RSA/SHA-1 signatures by default because SHA-1 is broken: per the <a href="https://www.openssh.org/txt/release-8.8">release notes</a>, a chosen-prefix collision costs under USD 50K. Your key and the host key can still be RSA; what gets rejected is the <strong>signature</strong> over SHA-1. A modern server signs with <code>rsa-sha2-256</code> or <code>rsa-sha2-512</code> and never triggers this.</p>
<p>Who still offers only <code>ssh-rsa</code> (or <code>ssh-dss</code>): HP iLO 2/3/4, switches and routers on old firmware, NAS boxes that were never updated, old Dropbear on embedded gear, Windows Server 2003 with a third-party SSH server, out-of-support appliances.</p>
<h2 id="variants-of-the-same-problem">Variants of the same problem</h2>
<table>
  <thead>
      <tr>
          <th>Message</th>
          <th>Option</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>no matching host key type found. Their offer: ssh-rsa</code></td>
          <td><code>-o HostKeyAlgorithms=+ssh-rsa</code></td>
      </tr>
      <tr>
          <td><code>no matching host key type found. Their offer: ssh-dss</code></td>
          <td><code>-o HostKeyAlgorithms=+ssh-dss</code> (OpenSSH &lt; 10.0)</td>
      </tr>
      <tr>
          <td><code>sign_and_send_pubkey: no mutual signature algorithm</code></td>
          <td><code>-o PubkeyAcceptedAlgorithms=+ssh-rsa</code></td>
      </tr>
      <tr>
          <td><code>no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1</code></td>
          <td><code>-o KexAlgorithms=+diffie-hellman-group14-sha1</code> (or <code>+diffie-hellman-group1-sha1</code>)</td>
      </tr>
      <tr>
          <td><code>no matching cipher found. Their offer: aes256-cbc,aes128-cbc,3des-cbc</code></td>
          <td><code>-c aes256-cbc</code> (same as <code>-o Ciphers=+aes256-cbc</code>)</td>
      </tr>
  </tbody>
</table>
<p><code>no mutual signature algorithm</code> is the same problem seen from your key: the server only accepts <code>ssh-rsa</code> signatures to authenticate <strong>your</strong> RSA key. Before OpenSSH 8.5 the option was called <code>PubkeyAcceptedKeyTypes</code>; the old name is still accepted as an alias.</p>
<p>An iLO 2 or 3 usually needs all of it at once:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">ssh -o <span class="nv">HostKeyAlgorithms</span><span class="o">=</span>+ssh-rsa <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>    -o <span class="nv">PubkeyAcceptedAlgorithms</span><span class="o">=</span>+ssh-rsa <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>    -o <span class="nv">KexAlgorithms</span><span class="o">=</span>+diffie-hellman-group14-sha1 <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>    -c aes256-cbc <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>    Administrator@ilo01
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="persistent-config">Persistent config</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span><span class="lnt">8
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># ~/.ssh/config
</span></span><span class="line"><span class="cl">Host ilo01
</span></span><span class="line"><span class="cl">    HostName ilo01.lab.example
</span></span><span class="line"><span class="cl">    User Administrator
</span></span><span class="line"><span class="cl">    HostKeyAlgorithms +ssh-rsa
</span></span><span class="line"><span class="cl">    PubkeyAcceptedAlgorithms +ssh-rsa
</span></span><span class="line"><span class="cl">    KexAlgorithms +diffie-hellman-group14-sha1
</span></span><span class="line"><span class="cl">    Ciphers +aes256-cbc
</span></span></code></pre></td></tr></table>
</div>
</div><p>Three details:</p>
<ul>
<li>The <code>+</code> <strong>appends</strong> to the default list. Without <code>+</code> you replace the whole list and that host will only negotiate what you typed.</li>
<li>Never put it under <code>Host *</code>: you would re-enable SHA-1 against every server you use.</li>
<li>If the host was already in <code>known_hosts</code> with a different key type: <code>ssh-keygen -R legacy-host</code> and connect again.</li>
</ul>
<h2 id="ssh-dss-on-openssh-10-or-newer">ssh-dss on OpenSSH 10 or newer</h2>
<p>DSA timeline in OpenSSH:</p>
<table>
  <thead>
      <tr>
          <th>Version</th>
          <th>Date</th>
          <th>DSA (<code>ssh-dss</code>)</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>7.0</td>
          <td>2015-08</td>
          <td>Disabled by default; <code>+ssh-dss</code> re-enables it</td>
      </tr>
      <tr>
          <td>9.8</td>
          <td>2024-07-01</td>
          <td>Disabled at compile time (<code>--enable-dsa-keys</code> to keep it)</td>
      </tr>
      <tr>
          <td>10.0</td>
          <td>2025-04-09</td>
          <td>Removed. No option brings it back</td>
      </tr>
  </tbody>
</table>
<p>Debian 13 (trixie) ships <code>openssh-client 10.0p1</code> and macOS Tahoe ships <code>OpenSSH_10.0p2</code>. On those clients:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">$ ssh -o HostKeyAlgorithms=+ssh-dss admin@legacy-host
</span></span><span class="line"><span class="cl">command-line line 0: Bad key types &#39;+ssh-dss&#39;.
</span></span></code></pre></td></tr></table>
</div>
</div><p>Check what your client can do before fighting the options:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">ssh -V
</span></span><span class="line"><span class="cl">ssh -Q key <span class="p">|</span> grep -c ssh-dss   <span class="c1"># 0 = your client no longer speaks ssh-dss</span>
</span></span><span class="line"><span class="cl">ssh -Q kex <span class="p">|</span> grep sha1         <span class="c1"># group1/group14-sha1 are still there in 10.x</span>
</span></span><span class="line"><span class="cl">ssh -Q cipher <span class="p">|</span> grep cbc       <span class="c1"># aes*-cbc and 3des-cbc are still there in 10.x</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>If the <code>grep -c</code> prints <code>0</code>, the practical way out is <strong>an older client in a container</strong>. Debian 12 (bookworm) ships OpenSSH 9.2p1, which still compiles DSA:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">docker run --rm -it debian:bookworm bash -c <span class="s1">&#39;
</span></span></span><span class="line"><span class="cl"><span class="s1">  apt-get update -qq &amp;&amp; apt-get install -y -qq openssh-client &gt;/dev/null &amp;&amp;
</span></span></span><span class="line"><span class="cl"><span class="s1">  ssh -o HostKeyAlgorithms=+ssh-dss \
</span></span></span><span class="line"><span class="cl"><span class="s1">      -o KexAlgorithms=+diffie-hellman-group1-sha1 \
</span></span></span><span class="line"><span class="cl"><span class="s1">      admin@192.168.1.10&#39;</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>Password auth works as is; if you need a key, mount it with <code>-v</code>. PuTTY (and <code>plink</code>) also still accept DSA, with a warning.</p>
<p>The real fix lives on the server: newer firmware, or an ed25519 / RSA host key with <code>rsa-sha2-256</code> (OpenSSH server has supported it since 7.2).</p>
<h2 id="see-what-the-server-offers">See what the server offers</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">ssh -vv admin@legacy-host 2&gt;<span class="p">&amp;</span><span class="m">1</span> <span class="p">|</span> grep -i <span class="s1">&#39;their offer&#39;</span>
</span></span><span class="line"><span class="cl">nmap -p <span class="m">22</span> --script ssh2-enum-algos legacy-host
</span></span></code></pre></td></tr></table>
</div>
</div><p><code>ssh2-enum-algos</code> lists the server&rsquo;s kex, host keys, ciphers, and MACs without authenticating.</p>
<h2 id="traps">Traps</h2>
<ul>
<li>This is a patch, not a fix: SHA-1 signatures and 1024-bit DH (<code>group1</code>) are weak. Use it only on isolated management networks and plan to update the device.</li>
<li>OpenSSH 10.0 also dropped the <code>diffie-hellman-group*</code> kex methods from the <strong>sshd</strong> defaults; the client keeps them. If a 10.x server is the one rejecting an old client, the knob is in <code>sshd_config</code>, not here.</li>
<li>On Fedora/RHEL there is also <code>crypto-policies</code>. A <code>Host</code> block in <code>~/.ssh/config</code> is read before the system policy and is safer than dropping everything to <code>LEGACY</code>.</li>
<li>On Windows, the built-in <code>ssh.exe</code> is OpenSSH and takes the same options; <code>ssh -V</code> tells you which version you have.</li>
</ul>
<h2 id="see-also">See also</h2>
<ul>
<li><a href="/en/posts/ilo/cli-commands/">iLO CLI commands</a> and <a href="/en/posts/ilo/upgrade-firmware-ssh/">upgrade iLO firmware over SSH</a> — the <code>-c aes256-cbc</code> cipher in action.</li>
<li><a href="/en/posts/windows/ssh-server-2003-bitvise/">SSH to Windows Server 2003 with Bitvise</a>.</li>
<li>OpenSSH: <a href="https://www.openssh.org/legacy.html">Legacy Options</a>, release notes for <a href="https://www.openssh.org/txt/release-8.8">8.8</a> and <a href="https://www.openssh.org/txt/release-10.0">10.0</a>.</li>
</ul>
]]></content:encoded></item></channel></rss>