<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: RescueShell</title>
    <description>The latest articles on DEV Community by RescueShell (@rescueshell).</description>
    <link>https://dev.to/rescueshell</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4243108%2F58d3dca3-4612-4cda-9a23-0deb42f87d96.png</url>
      <title>DEV Community: RescueShell</title>
      <link>https://dev.to/rescueshell</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rescueshell"/>
    <language>en</language>
    <item>
      <title>The ssh -R port that never asks who is connecting</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Wed, 02 Dec 2026 07:58:51 +0000</pubDate>
      <link>https://dev.to/rescueshell/the-ssh-r-port-that-never-asks-who-is-connecting-5fec</link>
      <guid>https://dev.to/rescueshell/the-ssh-r-port-that-never-asks-who-is-connecting-5fec</guid>
      <description>&lt;p&gt;You set up a reverse tunnel, the device dialled in, and &lt;code&gt;ssh -p 2222 localhost&lt;/code&gt; on the jump host lands you at the device's login prompt. It works. Before you move on, try one question: who else on that host can type the same command?&lt;/p&gt;

&lt;p&gt;A note on method first. I had no OpenSSH server in the environment where I wrote this, so none of it was run on a live pair of hosts. It is OpenSSH's documented behaviour. Check it against your version.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the forward is
&lt;/h2&gt;

&lt;p&gt;The usual shape, run on the device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh -N -R 2222:localhost:22 tunnel@jump.example.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;sshd on the jump host starts listening on 2222 and passes each connection back down the tunnel to the device's own sshd. A TCP listener knows nothing about which key built the tunnel or which user is connecting. Reach the port and you are talking to the device's SSH server, before any login.&lt;/p&gt;

&lt;p&gt;So the real question is where the port is bound.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Loopback only" is a smaller promise than it sounds
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;GatewayPorts&lt;/code&gt; defaults to &lt;code&gt;no&lt;/code&gt;, which keeps remote forwards on loopback and ignores a client's request for something wider. That sounds private. It only means that the connecting process must be on the jump host.&lt;/p&gt;

&lt;p&gt;Loopback ports have no owner and no file mode. Every engineer with a login, a build agent, a monitoring job, a contractor's service account, and anything an attacker runs under any of them can connect. Your devices are reachable by everyone who can run a command there.&lt;/p&gt;

&lt;p&gt;The other settings widen it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GatewayPorts yes&lt;/code&gt; binds forwards on every interface. On a cloud host that can mean the internet.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; lets the device choose. An old &lt;code&gt;-R 0.0.0.0:2222:localhost:22&lt;/code&gt; pasted from a wiki is enough to open a public listener, and nothing on the host records that the device was allowed to.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You pick one of these once and the next forward inherits it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a connection is worth
&lt;/h2&gt;

&lt;p&gt;Three consequences of landing on the device's sshd:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The device's own configuration is the only gate. Password login on, an old OpenSSH, a default account nobody renamed: all of it is as exposed as on a public address, just to a smaller crowd.&lt;/li&gt;
&lt;li&gt;Source-based controls go blind. The forward is made by the ssh client on the device, which talks to its own sshd over loopback, so every attempt looks like it comes from the device itself. A source-address rule cannot tell users of the jump host apart, and a ban tool that bans the address it sees would ban the path your own tunnel uses. I have not tried every ban tool, so test yours.&lt;/li&gt;
&lt;li&gt;It scales as a list. One port per device means a user cleared for one device can try the next port. Which port is which device usually lives in a script, not in anything that enforces it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What you can do on your own jump host
&lt;/h2&gt;

&lt;p&gt;All free, all some bookkeeping:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leave &lt;code&gt;GatewayPorts&lt;/code&gt; at &lt;code&gt;no&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Give the tunnel user a dedicated no-shell account and a &lt;code&gt;permitlisten&lt;/code&gt; option per device key (OpenSSH 7.8 or newer) so a device can bind only its own port. That limits what a device can ask for, not who connects afterwards.&lt;/li&gt;
&lt;li&gt;Forward to a Unix socket, for example &lt;code&gt;-R /run/tunnel/dev17.sock:localhost:22&lt;/code&gt;. A socket has an owner and a mode, so "who can connect" turns into a permissions question you can answer with &lt;code&gt;ls -l&lt;/code&gt;. Remember the directory above it matters. OpenSSH supports this from 6.7. I did not run it for this post.&lt;/li&gt;
&lt;li&gt;Keep the list of people with a login short, and read it as the list of people who can try every device.&lt;/li&gt;
&lt;li&gt;Turn off password login on the devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A small team with one host only they use, &lt;code&gt;GatewayPorts&lt;/code&gt; at its default and key-only devices is a reasonable setup. The exposure grows with the number of accounts and devices behind the host.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design we chose instead
&lt;/h2&gt;

&lt;p&gt;Our agent does not use a forward. It dials out over HTTPS to a relay we run, and the device opens no port. When a shell is requested, the agent connects to the device's own SSH server on the device's own loopback address and nothing else, so there is no middle-host listener to try and no neighbouring port.&lt;/p&gt;

&lt;p&gt;The key made available for a session appears only after your key has signed a fresh challenge. It is a short-lived file with no port, agent or X11 forwarding, and it is accepted only for a connection from the device's own loopback address, which is the agent's own connection. The agent refuses password sessions, and the device keeps its own list of trusted keys that our servers cannot add to.&lt;/p&gt;

&lt;p&gt;Limits, stated plainly: someone who already has a shell on the device is on that address too, and we do not claim to separate them from their own machine. The device's SSH server is still a listener on the device, and if the image binds to all interfaces the local network can reach it with or without us. It is a relay we run, so if it is down you cannot get a shell through it. We offer no uptime SLA or high availability, and we can see metadata such as who connected to which device and when.&lt;/p&gt;

&lt;p&gt;The full post, with the same model laid out step by step, is on the RescueShell blog: &lt;a href="https://rescueshell.com/blog/who-can-connect-to-an-ssh-r-forwarded-port/" rel="noopener noreferrer"&gt;https://rescueshell.com/blog/who-can-connect-to-an-ssh-r-forwarded-port/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>linux</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>The evening my SSH hostname stopped answering: four checks, and when to stop</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Sat, 28 Nov 2026 13:29:41 +0000</pubDate>
      <link>https://dev.to/rescueshell/the-evening-my-ssh-hostname-stopped-answering-four-checks-and-when-to-stop-5d71</link>
      <guid>https://dev.to/rescueshell/the-evening-my-ssh-hostname-stopped-answering-four-checks-and-when-to-stop-5d71</guid>
      <description>&lt;p&gt;It is a little after six. You type &lt;code&gt;ssh home.example.com&lt;/code&gt;, the same line you have typed for two years, and the cursor sits there. Ten seconds, thirty, then &lt;code&gt;Connection timed out&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Nothing on your side changed. Which is the unsettling part, because something on the other side did, and the machine is not telling you what.&lt;/p&gt;

&lt;p&gt;Before you reinstall anything, work out which link in the chain broke. There are four, and the order matters, because each check narrows what the next one can mean.&lt;/p&gt;

&lt;h2&gt;
  
  
  The chain you were relying on
&lt;/h2&gt;

&lt;p&gt;A dynamic DNS name is several small jobs done by several parties. A client at the remote site notices its address changed. It tells a DNS provider. The provider publishes the new address. Your laptop looks the name up. Finally, a port forward on the router lets the connection in. Any one of those can stop, and the symptom is always the same timeout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 1: what does the name resolve to?
&lt;/h2&gt;

&lt;p&gt;From your laptop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig +short home.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No answer at all means the record is gone. The hostname expired, or the account behind it lapsed. This is the cheapest failure to fix and the most embarrassing one to find at six in the evening.&lt;/p&gt;

&lt;p&gt;An answer means move on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 2: is that the address the site has now?
&lt;/h2&gt;

&lt;p&gt;On the site, or through anyone who is there, open any "what is my IP" page and compare it with what &lt;code&gt;dig&lt;/code&gt; returned.&lt;/p&gt;

&lt;p&gt;If they differ, the update never arrived. The usual causes are dull: the update client stopped, it lived on a router that was reset or replaced, or it holds a password that has since changed. Look at the client's log before you touch anything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 3: is that even the router's own address?
&lt;/h2&gt;

&lt;p&gt;This is the one people skip, and it is the one that ends the story. Open the router's status page and read its WAN address. Compare it with the address from check 2.&lt;/p&gt;

&lt;p&gt;If they match and it is an ordinary public address, carry on to check 4. If they differ, or the WAN address falls between &lt;code&gt;100.64.0.0&lt;/code&gt; and &lt;code&gt;100.127.255.255&lt;/code&gt;, your provider is sharing one public address between many customers. A forward on your router is then never reached, and no amount of DNS work changes that. Stop here. There is a separate write-up on &lt;a href="https://rescueshell.com/guides/ssh-behind-cgnat/" rel="noopener noreferrer"&gt;SSH behind CGNAT&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 4: does the port answer?
&lt;/h2&gt;

&lt;p&gt;From outside the network, a phone on mobile data will do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nc -vz home.example.com 22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the answer carries information. If the address was right all along, a refusal or a timeout points at one of three things: the forward on the router, the firewall on the machine itself, or the router having handed the machine a different internal address, so the forward aims at nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two quiet causes
&lt;/h2&gt;

&lt;p&gt;A record keeps its old answer in caches until its TTL runs out, so just after a change the name can still lead to the old address. Wait, or set a short TTL for next time.&lt;/p&gt;

&lt;p&gt;And the home IPv6 prefix can change as well. If you published an AAAA record, it needs the same update client as the A record. Otherwise the name can keep pointing at an old IPv6 address.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to stop fixing DNS
&lt;/h2&gt;

&lt;p&gt;If checks 1 to 4 found a stopped client or a bad forward, repair it. Keep the update client on a machine that stays on, make sure it logs success, and keep the TTL short. That is free or cheap, and entirely reasonable when the router is yours, it has a public address, and you accept SSH being open to the internet. In that case allow keys only with &lt;code&gt;PasswordAuthentication no&lt;/code&gt; in &lt;code&gt;sshd_config&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Stop when the cause is on the list you cannot change: the router is somebody else's, or the address is shared, or you are tired of the third failure this year. There the name was only ever a note of where the machine was, and the note will go stale again.&lt;/p&gt;

&lt;p&gt;Two ways out do not need a repaired note. IPv6 can work if both ends have it and the router's firewall lets the connection in, but the prefix can change, so you still need a name that follows it. Or turn the arrangement around so the machine dials out: a reverse tunnel to a server you rent, a mesh VPN, or a hosted relay. Then the address of the site stops mattering. There is a &lt;a href="https://rescueshell.com/guides/reverse-ssh-vs-vpn-mesh/" rel="noopener noreferrer"&gt;comparison of the three&lt;/a&gt;, and notes on &lt;a href="https://rescueshell.com/guides/autossh-tunnel-keeps-dropping/" rel="noopener noreferrer"&gt;why autossh tunnels drop&lt;/a&gt; if you go the tunnel route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing it with no hostname
&lt;/h2&gt;

&lt;p&gt;We build RescueShell, which is the hosted relay option, so weigh this section with that in mind. An agent on the device keeps one outbound HTTPS connection to the relay. You pick the device by name from a list and open a shell in the browser or from the CLI. There is no address to publish, so there is nothing to go stale.&lt;/p&gt;

&lt;p&gt;The shell is a session on the device's own OpenSSH server, so it needs one running, and your key in the account's &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;. If the old hostname still lets you in, you have that already. Check the rest on the device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uname -m
openssl version
&lt;span class="nb"&gt;command&lt;/span&gt; -v curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It needs Linux on amd64, arm64, armv7 or armv6, and curl or wget. Any other CPU stops with &lt;code&gt;unsupported CPU&lt;/code&gt;. The release signature is checked with OpenSSL 3, so without it pass &lt;code&gt;--sha256&lt;/code&gt;. Dropbear is not supported.&lt;/p&gt;

&lt;p&gt;In the web app, open &lt;strong&gt;Devices&lt;/strong&gt;, choose &lt;strong&gt;Add device&lt;/strong&gt;, name it and create a pass. Then, as root on the device, over the old hostname while it still works or at its console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://releases.rescueshell.com/latest/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh -s -- \
  --base-url https://releases.rescueshell.com/latest --relay https://app.rescueshell.com \
  --name pump-07 --trust-keys-from pi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;pi&lt;/code&gt; with the account whose keys you use and &lt;code&gt;pump-07&lt;/code&gt; with a name for the device. The installer lists each key it will trust by fingerprint and waits for you to confirm. It then asks for &lt;code&gt;Registration pass or token:&lt;/code&gt;; paste the pass, and expect the terminal to stay blank. The last line is &lt;code&gt;host key:&lt;/code&gt;. Keep it, because the browser asks for it the first time you open a shell. Our servers cannot add a key to the device's list.&lt;/p&gt;

&lt;p&gt;Confirm the agent is running with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rescueshell-agent --status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, once the device shows as connected, open a shell from a different network. Your phone's hotspot is enough. Only after that works should you remove the router forward and the update client. Keep the old route until the new one has worked once.&lt;/p&gt;

&lt;p&gt;The device needs outbound HTTPS and nothing inbound. If the link drops, the agent retries every 60 seconds, five times, then waits 30 minutes and starts over, so it comes back on its own whatever address it was given.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One shell open per device at a time.&lt;/li&gt;
&lt;li&gt;Port forwarding through a session is off. A web page or another machine on the device's network is not reachable this way, so if the hostname served more than SSH, you still need something else for that.&lt;/li&gt;
&lt;li&gt;The relay is a dependency. If it is unreachable you cannot open a shell, where a working hostname and forward depend only on your DNS provider and your own router.&lt;/li&gt;
&lt;li&gt;OpenSSH only.&lt;/li&gt;
&lt;li&gt;A device that is powered off or off the network cannot be reached, and nor can one on a network where web traffic only leaves through an HTTP proxy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full version, with the options laid out, is on our site: &lt;a href="https://rescueshell.com/guides/dynamic-dns-ssh-not-working/" rel="noopener noreferrer"&gt;https://rescueshell.com/guides/dynamic-dns-ssh-not-working/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;RescueShell is a remote shell service for fleets of devices, hosted in the EU (&lt;a href="https://rescueshell.com/legal/eu-residency/" rel="noopener noreferrer"&gt;exceptions listed&lt;/a&gt;). Your first device is free to try with no card, and the 30-day trial starts when it connects. Until you add a card, shell traffic is capped at 50 MB in total and a second device needs a card. After that it is €0.10 per device a month, billed yearly, with a €6 yearly minimum, plus VAT.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.rescueshell.com/admin/signup?ref=devto" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>linux</category>
      <category>networking</category>
      <category>devops</category>
    </item>
    <item>
      <title>Audit your known_hosts: who said yes, and what did they check?</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Fri, 27 Nov 2026 09:41:47 +0000</pubDate>
      <link>https://dev.to/rescueshell/audit-your-knownhosts-who-said-yes-and-what-did-they-check-58b0</link>
      <guid>https://dev.to/rescueshell/audit-your-knownhosts-who-said-yes-and-what-did-they-check-58b0</guid>
      <description>&lt;p&gt;Open your team's &lt;code&gt;known_hosts&lt;/code&gt; file, or the one pasted into the wiki, and pick any line. Now try to answer three things about it. Who accepted that key? What did they compare it against? Was it compared against anything at all?&lt;/p&gt;

&lt;p&gt;On many teams nobody can answer. The entry is there, it works, and nobody recorded the moment it was created. That moment was a person at a terminal, probably in a hurry, typing &lt;code&gt;yes&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the prompt really asks
&lt;/h2&gt;

&lt;p&gt;The first time a client meets a host, it has nothing to check the key against. It prints a fingerprint, says it cannot establish authenticity, and waits. Whatever you answer becomes the baseline. Every later connection that matches proves only that it matches the first one.&lt;/p&gt;

&lt;p&gt;So the check holds on every connection except the one that counted. If something was sitting in the path that first time, the stored entry now vouches for it.&lt;/p&gt;

&lt;p&gt;Nobody is reckless here. A device is down, a customer is on the phone, and the fingerprint on screen is a string with nothing to set it against. Typing &lt;code&gt;yes&lt;/code&gt; is how the job gets done.&lt;/p&gt;

&lt;h2&gt;
  
  
  One answer, copied a hundred times
&lt;/h2&gt;

&lt;p&gt;The entry rarely stays with the person who made it. A working line gets pasted into the wiki under "connecting to the relay". A colleague copies it. A laptop template ships with it. A provisioning script sets &lt;code&gt;StrictHostKeyChecking=accept-new&lt;/code&gt; so nobody is asked again, which is the same &lt;code&gt;yes&lt;/code&gt;, given once on behalf of every host to come.&lt;/p&gt;

&lt;p&gt;A few months later a good share of the fleet's trust traces back to one tired answer. There is no ticket, no name and no fingerprint written down anywhere except the file that now defends itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The second yes is worse
&lt;/h2&gt;

&lt;p&gt;When a key changes, the client refuses with a loud warning about a man-in-the-middle. The well-known fix is to delete the line and reconnect. Usually that is right: a unit was reimaged, a router was swapped, a relay was rebuilt. In a fleet of any size those happen so often that the warning becomes a chore.&lt;/p&gt;

&lt;p&gt;That is the real cost. When nearly every change is routine, the rare genuine one looks routine too, and the person staring at it cannot tell them apart. A check dismissed by habit is only as strong as the habit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evidence the path cannot supply
&lt;/h2&gt;

&lt;p&gt;If the connection runs through a relay, the fingerprint you are shown may come from whoever runs that relay, which is the party you most want to be able to distrust. For the check to mean anything, the evidence has to arrive another way. Three parts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read the fingerprint somewhere else.&lt;/strong&gt; The device knows its own host key. If you can read the fingerprint off the device, for example from what the installer printed, you hold a value the path never touched. Compare all of it. Matching the first and last few characters is a habit worth dropping. A full comparison is tedious, and the tedium is the point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pin it.&lt;/strong&gt; Once it has been checked against that independent source, store it and compare every later connection against the stored value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make accepting a change its own act.&lt;/strong&gt; A changed key should stop the connection and stay stopped until someone with the authority to decide says it is legitimate. Deleting a line in your home directory is a private act. Accepting a change for the team should have an owner.&lt;/p&gt;

&lt;p&gt;This is how we built RescueShell's shell access. The CLI and the browser shell check a device's host key against a fingerprint you paste from the device's first connection, and they refuse a later change. The relay records the first host key it sees for a device and refuses shells if it changes, until an admin accepts the new key. Key changes and accepts are recorded as fingerprints only, never key bodies. Refused sessions are recorded as well, and admins can see who opened a shell, on which device, and when.&lt;/p&gt;

&lt;h2&gt;
  
  
  The reason still lives with you
&lt;/h2&gt;

&lt;p&gt;The record tells you that a key changed and when it was accepted. It cannot tell you why. That belongs in your own ticket or change log, and the habit we would push is one sentence there before you click accept: what changed, and how you know. If a device was reimaged on purpose, you already know the answer. If nobody can explain a change, find that out first.&lt;/p&gt;

&lt;p&gt;The same applies to the first paste. Whoever pastes the fingerprint should be able to say where it came from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this falls short
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where the pasted fingerprint came from decides everything.&lt;/strong&gt; If it was copied from a page the relay served, or from a message that travelled the same route, this is trust on first use with extra typing. We cannot see where your string came from.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accepting a change is still a human decision.&lt;/strong&gt; We make it explicit and put it on record. We cannot make it correct. An admin who accepts under pressure without knowing why the key moved has repeated the old mistake somewhere more people can see it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It takes more steps than typing &lt;code&gt;yes&lt;/code&gt;.&lt;/strong&gt; For a handful of machines on a bench within reach, a plain jump host and a &lt;code&gt;known_hosts&lt;/code&gt; file you verified once may be the sensible choice. The extra care pays back as the fleet and the team grow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Some devices attest instead of paste.&lt;/strong&gt; When many devices are enrolled in one pass, the pin can rest on an attestation rather than a pasted fingerprint. If the enrolment secret ever leaks, that is the weaker route.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;We see metadata.&lt;/strong&gt; Who connected where, and when, is visible to our backend, and whoever operates the backend or relay can still refuse or drop sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No red-team result.&lt;/strong&gt; Our goal is that full control of our backend and relay opens zero shells. No red-team exercise has tested that, so it is a goal and not a finding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The log is not a recording.&lt;/strong&gt; It lists events. There is no session recording, no audit export, and no uptime SLA.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two questions are still open on our side: how a team should hand the first fingerprint to a colleague without it passing back through the same path, and how often an unchanged pin should be re-checked. We have no rule that suits every fleet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the audit
&lt;/h2&gt;

&lt;p&gt;Pick ten lines from your &lt;code&gt;known_hosts&lt;/code&gt;. For each, write down where the fingerprint came from. Wherever the answer is "the connection itself", you have found a standing decision nobody made on purpose.&lt;/p&gt;

&lt;p&gt;The longer version of this argument is on our site: &lt;a href="https://rescueshell.com/blog/the-first-yes-on-a-jump-host-is-a-standing-decision/" rel="noopener noreferrer"&gt;https://rescueshell.com/blog/the-first-yes-on-a-jump-host-is-a-standing-decision/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;RescueShell is a remote shell service for fleets of devices, hosted in the EU (&lt;a href="https://rescueshell.com/legal/eu-residency/" rel="noopener noreferrer"&gt;exceptions listed&lt;/a&gt;). Your first device is free to try with no card, and the 30-day trial starts when it connects. Until you add a card, shell traffic is capped at 50 MB in total and a second device needs a card. After that it is €0.10 per device a month, billed yearly, with a €6 yearly minimum, plus VAT.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.rescueshell.com/admin/signup?ref=devto" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>security</category>
      <category>linux</category>
      <category>devops</category>
    </item>
    <item>
      <title>Remote access to a Pi you can't open a port on: what we'd try, in order</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Thu, 26 Nov 2026 09:17:39 +0000</pubDate>
      <link>https://dev.to/rescueshell/remote-access-to-a-pi-you-cant-open-a-port-on-what-wed-try-in-order-1f9m</link>
      <guid>https://dev.to/rescueshell/remote-access-to-a-pi-you-cant-open-a-port-on-what-wed-try-in-order-1f9m</guid>
      <description>&lt;p&gt;Most remote-access advice for the Raspberry Pi skips the question that decides everything: can you get a connection to arrive at the Pi at all? If you can, the cheapest fix is a few lines of router config. If you can't, you need the Pi to make the call instead of waiting for one. Here is how we would work through it, cheapest first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the free option and see if it fits
&lt;/h2&gt;

&lt;p&gt;Forward port 22 on the router, give your changing home address a dynamic DNS name, and log in with a key. It is old, it is dull, and it works. It needs three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You control the router.&lt;/strong&gt; A Pi at a customer's shop or a relative's house usually sits behind equipment you will never get into.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The router's own WAN address is public IPv4.&lt;/strong&gt; Lots of home and mobile lines share one address across many subscribers, and a forward on your router then goes nowhere. Look at the WAN address on the router status page, then look up your public address on any "what is my IP" site. Two different numbers mean CGNAT, and our &lt;a href="https://rescueshell.com/guides/ssh-behind-cgnat/" rel="noopener noreferrer"&gt;SSH behind CGNAT guide&lt;/a&gt; picks up from there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You accept SSH being reachable from the whole internet.&lt;/strong&gt; If you do, put &lt;code&gt;PasswordAuthentication no&lt;/code&gt; in &lt;code&gt;sshd_config&lt;/code&gt; and allow keys only. A non-standard port thins out the log noise. It does not make you safer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When all three are true, a key-only forward costs nothing and is simple. Do that and close the tab.&lt;/p&gt;

&lt;p&gt;If even one fails, read on. We build RescueShell, which is the last option below, so we have tried to describe the other three the way people who use them would.&lt;/p&gt;

&lt;h2&gt;
  
  
  Raspberry Pi Connect
&lt;/h2&gt;

&lt;p&gt;Raspberry Pi's own service. According to its documentation, which we read on 25 November 2026, it is free for personal accounts and wants Raspberry Pi OS Bookworm or newer. Your browser talks to the Pi directly when it can, and goes through an encrypted relay when it can't.&lt;/p&gt;

&lt;p&gt;It offers a remote shell, and screen sharing on the full version. Lite, the default on Raspberry Pi OS Lite, gives you the shell only. For one Pi and one Raspberry Pi account, the price is hard to beat.&lt;/p&gt;

&lt;h2&gt;
  
  
  A VPN mesh like Tailscale or WireGuard
&lt;/h2&gt;

&lt;p&gt;Pi and laptop both join a private network, and you &lt;code&gt;ssh&lt;/code&gt; to the Pi's address inside it. Every port is reachable, so a shell is only one of the things you get.&lt;/p&gt;

&lt;p&gt;What you pay is maintenance. A client has to be installed and kept running on the Pi and on each machine you connect from. The Pi also becomes part of your network and remains there.&lt;/p&gt;

&lt;h2&gt;
  
  
  A reverse SSH tunnel to a rented server
&lt;/h2&gt;

&lt;p&gt;The Pi runs &lt;code&gt;ssh -R&lt;/code&gt; toward a server with a public address. You sign in to the server, then follow the forwarded port back down to the Pi.&lt;/p&gt;

&lt;p&gt;With one Pi and a server you already pay for, that is a reasonable setup. The chores are patching the server and keeping the tunnel up. If the tunnel is what has been annoying you, &lt;a href="https://rescueshell.com/guides/autossh-tunnel-keeps-dropping/" rel="noopener noreferrer"&gt;why autossh tunnels drop&lt;/a&gt; lists the usual causes, and &lt;a href="https://rescueshell.com/guides/reverse-ssh-vs-vpn-mesh/" rel="noopener noreferrer"&gt;reverse SSH versus a VPN mesh&lt;/a&gt; sets the approaches next to each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  A hosted relay
&lt;/h2&gt;

&lt;p&gt;An agent on the Pi keeps a single outbound HTTPS connection open to the relay. From the browser or the CLI you ask for a shell. You run no server, and nothing gets added to the Pi's network.&lt;/p&gt;

&lt;p&gt;The catch is plain: the relay is a dependency. When it can't be reached, no shell opens. It makes the most sense for Pis you give to other people, or a small group you want in one list showing who opened a shell and when. That is what RescueShell is, and the next sections show it on a Pi today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting a Pi onto RescueShell
&lt;/h2&gt;

&lt;h3&gt;
  
  
  SSH first, then your key
&lt;/h3&gt;

&lt;p&gt;Our shell is a session on the Pi's own OpenSSH server, and Raspberry Pi OS ships that switched off. Enable it under Interface Options in &lt;code&gt;raspi-config&lt;/code&gt;, or run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; --now ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then copy your key over from the laptop. The installer reads trusted keys from an account's &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;, so they have to be in place beforehand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id pi@raspberrypi.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap in the account you made when you set the Pi up; &lt;code&gt;pi&lt;/code&gt; is only the name on older images. No key yet? &lt;code&gt;ssh-keygen -t ed25519&lt;/code&gt; makes one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three quick checks
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uname -m
openssl version
&lt;span class="nb"&gt;command&lt;/span&gt; -v curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;curl or wget must be present. The architecture decides which build you get:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;uname -m&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Build&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;aarch64&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;arm64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;armv7l&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;armv7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;armv6l&lt;/code&gt; (Zero and Pi 1)&lt;/td&gt;
&lt;td&gt;armv6&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Anything else ends with &lt;code&gt;unsupported CPU&lt;/code&gt;. Signatures are verified with OpenSSL 3, present in Raspberry Pi OS since Bookworm. On an older image, pass &lt;code&gt;--sha256&lt;/code&gt;. The installer does not install packages for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run the installer
&lt;/h3&gt;

&lt;p&gt;In the web app choose &lt;strong&gt;Add device&lt;/strong&gt; and create a pass. Then, as root on the Pi (after &lt;code&gt;sudo -i&lt;/code&gt;, say), over SSH from your home network or at the console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://releases.rescueshell.com/latest/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh -s -- \
  --base-url https://releases.rescueshell.com/latest --relay https://app.rescueshell.com \
  --name pump-07 --trust-keys-from pi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;pi&lt;/code&gt; with your account and &lt;code&gt;pump-07&lt;/code&gt; with whatever you want to call this Pi.&lt;/p&gt;

&lt;p&gt;First it prints each key it will trust, by fingerprint, and waits for a yes. Next comes the prompt &lt;code&gt;Registration pass or token:&lt;/code&gt;. Paste the pass; the terminal stays blank while you do. The last thing printed is a &lt;code&gt;host key:&lt;/code&gt; line. Hold on to it, since the browser asks for it the first time you open a shell. Our servers have no way to add a key to the Pi's list. The &lt;a href="https://rescueshell.com/docs/add-a-device/" rel="noopener noreferrer"&gt;add-a-device docs&lt;/a&gt; cover other ways to do this.&lt;/p&gt;

&lt;p&gt;On systemd, which is what Raspberry Pi OS runs, you get &lt;code&gt;rescueshell-agent.service&lt;/code&gt;. It starts when the network is online and restarts the agent after a failure. One drop-in file goes into &lt;code&gt;/etc/ssh/sshd_config.d/&lt;/code&gt;, and your main &lt;code&gt;sshd_config&lt;/code&gt; is untouched. To confirm it is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status rescueshell-agent
rescueshell-agent --status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use it
&lt;/h3&gt;

&lt;p&gt;Once the Pi appears as connected under &lt;strong&gt;Devices&lt;/strong&gt;, open a shell in the browser or from a terminal with the &lt;a href="https://rescueshell.com/docs/cli/" rel="noopener noreferrer"&gt;CLI&lt;/a&gt;. Test from somewhere else first, such as your phone's hotspot, before you count on it.&lt;/p&gt;

&lt;p&gt;Only outbound HTTPS is needed, and nothing inbound. If the connection drops, the agent tries again every 60 seconds, five times, then backs off for 30 minutes and repeats. A Pi that lost its network comes back without help. When a shell won't open, start with the &lt;a href="https://rescueshell.com/docs/troubleshooting/#no-shell" rel="noopener noreferrer"&gt;troubleshooting page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it falls short
&lt;/h2&gt;

&lt;p&gt;Better to know now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One shell can be open per device at a time.&lt;/li&gt;
&lt;li&gt;There is no desktop and no VNC. Port forwarding through a session is turned off, so a web page, or another machine on the Pi's network, can't be reached this way. If you want a desktop, Raspberry Pi Connect or a mesh suits you better.&lt;/li&gt;
&lt;li&gt;OpenSSH only. Dropbear is not supported.&lt;/li&gt;
&lt;li&gt;A Pi that is powered off or off the network can't be reached, and nothing here stands in for a power cycle or a console.&lt;/li&gt;
&lt;li&gt;The agent can't work on a network where web traffic only gets out through an HTTP proxy. For a customer's site, &lt;a href="https://rescueshell.com/guides/customer-firewall-ssh/" rel="noopener noreferrer"&gt;what to ask their IT team&lt;/a&gt; is worth a look.&lt;/li&gt;
&lt;li&gt;Our test matrix is Debian and Ubuntu containers plus a 32-bit Alpine ARM machine in QEMU. Real Raspberry Pi hardware is not in it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For many Pis, image builds or a read-only root, see &lt;a href="https://rescueshell.com/guides/raspberry-pi-remote-ssh/" rel="noopener noreferrer"&gt;Remote SSH for a fleet of Raspberry Pis&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The original of this write-up is on our site: &lt;a href="https://rescueshell.com/guides/raspberry-pi-ssh-from-anywhere/" rel="noopener noreferrer"&gt;SSH into a Raspberry Pi from anywhere&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;RescueShell is a remote shell service for Linux devices, hosted in the EU (&lt;a href="https://rescueshell.com/legal/eu-residency/" rel="noopener noreferrer"&gt;exceptions listed&lt;/a&gt;). The first device is free to try, no card. The 30-day trial starts when it connects. Until a card is added, shell traffic is capped at 50 MB in total and a second device needs a card. After that it is â‚¬0.10 per device per month, billed yearly, with a â‚¬6 yearly minimum, plus VAT.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.rescueshell.com/admin/signup?ref=devto" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>ssh</category>
      <category>linux</category>
      <category>devops</category>
    </item>
    <item>
      <title>Replay, stockpile, skip: how a device should accept a key change</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Sat, 21 Nov 2026 17:30:26 +0000</pubDate>
      <link>https://dev.to/rescueshell/replay-stockpile-skip-how-a-device-should-accept-a-key-change-126</link>
      <guid>https://dev.to/rescueshell/replay-stockpile-skip-how-a-device-should-accept-a-key-change-126</guid>
      <description>&lt;p&gt;Suppose a laptop goes missing and you want its key gone from every device it could open. Before asking how to do that, ask a stricter question: who is allowed to tell a device "trust this key" or "stop trusting that one", and what exactly does the device check before it believes them?&lt;/p&gt;

&lt;p&gt;On a classic reverse-SSH setup the answer is vague. A shared key sits on every device, a public half sits on a jump host, and whoever can edit that file on the host effectively decides. We wanted the decision to live on the device and to be checkable by it. This post walks through the rules we settled on, and the places where they stop helping. The original, with the full write-up, is &lt;a href="https://rescueshell.com/blog/the-keys-on-a-jump-host-outlast-the-people/" rel="noopener noreferrer"&gt;on our site&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start by deleting the shared key
&lt;/h2&gt;

&lt;p&gt;There is no shared fleet key. Each provisioning credential belongs to one team, and each device holds its own list of trusted public keys and the accounts those keys may open. The cap is 20 keys and 20 accounts per device.&lt;/p&gt;

&lt;p&gt;A fresh install has to be handed that set, and it will not run without it. The installer prints every fingerprint and every account and asks you to confirm. Our servers cannot add a key or an account to a device. If you are migrating from an older setup, you can seed the list from an existing account's authorized keys at install time instead of starting clean.&lt;/p&gt;

&lt;h2&gt;
  
  
  After install, one door
&lt;/h2&gt;

&lt;p&gt;Once a device is running, its list changes in exactly one way: a change signed by a key the device already trusts. The signature namespace is &lt;code&gt;rescueshell-trust-v1&lt;/code&gt;. The signed payload names three things: the device, the next version number, and the challenge that device is holding for its current connection.&lt;/p&gt;

&lt;p&gt;Each of those exists to shut a specific attack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replay.&lt;/strong&gt; The version must be the device's stored version plus one. An old change, resent, is stale and refused.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skip.&lt;/strong&gt; The same rule works the other way. A change that jumps ahead of the stored version plus one is refused too, so nothing can be slipped in out of order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stockpile.&lt;/strong&gt; The challenge changes on every connection. A signed change cannot be collected today and applied next week, because the challenge it names will be gone.&lt;/p&gt;

&lt;p&gt;The device also requires that the signer is on its current list, and that the resulting list still has at least one key and at least one account. Writes are done so that a crash mid-update leaves each file either old or new, never half written.&lt;/p&gt;

&lt;p&gt;Our server's job is to hold the signed change and pass it along. It has no signing role. If it misbehaves, the worst outcomes are a dropped change, a delayed one, or a replayed one, and the device refuses the replay as stale.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lost laptop, as one command
&lt;/h2&gt;

&lt;p&gt;From a key that is still trusted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rescueshell trust &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;device&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --sign-with ~/.ssh/other_key --add-key new.pub --remove-key lost.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a fleet, one signature can cover a group of online devices, up to 50 per batch, from the CLI or the browser, with one passkey tap or one passphrase. Both show each key fingerprint, each account and the signer before you confirm, and the relay counts the batch as one request. The tool will not sign a change that removes the key doing the signing, or that would leave a device with no key or no login account.&lt;/p&gt;

&lt;p&gt;So rotation becomes: add the new key, check it works, remove the old one. Nothing is copied around and no shared file is edited.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two removals, kept apart on purpose
&lt;/h2&gt;

&lt;p&gt;When a person leaves, two separate things have to happen.&lt;/p&gt;

&lt;p&gt;Removing them from the team is immediate. They can no longer open a shell through RescueShell on any device, online or offline, and their open shells end right away.&lt;/p&gt;

&lt;p&gt;Removing their key from the devices is a signed change, as above. It still matters, because a key on a device's list is trusted by that device regardless of what happened to the team account that used it.&lt;/p&gt;

&lt;p&gt;For audit, the server records key changes, host key accepts and refused sessions as fingerprints, never key bodies. Each agent keeps its own chained log of the shells it granted or refused. You can read that log, but there is no export and no session recording.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this falls short
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;We cannot know someone left.&lt;/strong&gt; Taking a person off the team and taking their key off the devices are your jobs. Nothing feeds from your HR system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A key on the device keeps working until you remove it.&lt;/strong&gt; Team removal cuts access through us. It does not edit the device's list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline devices keep the old list.&lt;/strong&gt; A change names a challenge that exists only while the device is connected, so nothing is queued. Run it again when the device returns. The tool shows which devices are likely still on the old list, from what they last reported. That is a hint, not proof.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Signing needs a trusted key.&lt;/strong&gt; Lose every key a device trusts and nobody can sign for it. The fix is to run the installer again on the device, as root.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A hostile browser frame could get a bad change signed&lt;/strong&gt; with a key you unlock in it. Our threat model lists this as a residual risk, along with the protections we lean on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metadata is visible, and availability is ours to lose.&lt;/strong&gt; We can see who connected where and when. When our servers are down, you get no shell through them, and we promise no uptime SLA and no high availability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It is more steps than a shared key.&lt;/strong&gt; With a handful of machines on a bench, a single key on a jump host is a fair choice and takes less effort. Per-device lists cost something each time you onboard a person, and they pay off as the fleet and the turnover grow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One last caveat. The target is that someone holding full control of our backend and relay still opens zero shells. The red-team round that would test that end to end has not been run. Treat it as a goal, not a result.&lt;/p&gt;




&lt;p&gt;RescueShell is a remote shell service for fleets of devices, hosted in the EU (&lt;a href="https://rescueshell.com/legal/eu-residency/" rel="noopener noreferrer"&gt;exceptions listed&lt;/a&gt;). First device free to try, no card. The 30-day trial starts when it connects. Until a card is added, shell traffic is capped at 50 MB in total and a second device needs a card. After that: €0.10 per device per month, billed yearly, €6 yearly minimum, plus VAT.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.rescueshell.com/admin/signup?ref=devto" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>security</category>
      <category>linux</category>
      <category>devops</category>
    </item>
    <item>
      <title>What a reverse SSH tunnel leaves open</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:37:16 +0000</pubDate>
      <link>https://dev.to/rescueshell/what-a-reverse-ssh-tunnel-leaves-open-2akm</link>
      <guid>https://dev.to/rescueshell/what-a-reverse-ssh-tunnel-leaves-open-2akm</guid>
      <description>&lt;p&gt;Every reverse SSH tunnel has the same quiet clause in its fine print: whoever runs the server in the middle gets a say in who reaches your devices. For one machine on your own desk that is fine, because the server is yours. It stops being fine when the server is shared, hosted by someone else, or simply the one box in your estate that an attacker would most like to own.&lt;/p&gt;

&lt;p&gt;This post is one argument: the middle server should not be part of any device's trust decision, so the decision has to live on the device. We will go through what that means in RescueShell, what it still does not cover, and what it costs you. We describe built design and what our security page says. We have not run a hostile-relay exercise against it and we do not claim one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup that makes the server powerful
&lt;/h2&gt;

&lt;p&gt;A reverse tunnel exists because the device sits behind a firewall you do not control. It dials out to a server you do, and you reach it through that server. The server decides which keys get to the device, or at least sits where it can change that decision. Add a key there and you have a shell on every device behind it.&lt;/p&gt;

&lt;p&gt;So the real question is not whether the tunnel is encrypted. It is: if someone took over the middle, what could they open?&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving the decision onto the device
&lt;/h2&gt;

&lt;p&gt;Each RescueShell device keeps its own list of trusted keys and accounts. Our servers cannot add a key or an account to it. A new install has to be given that list and refuses to run without it. If our servers were compromised, they still could not add a key or an account on a device.&lt;/p&gt;

&lt;p&gt;Changing that list is also a device-side decision. Adding or removing a key is a trust change that has to be signed by a key the device already trusts (namespace &lt;code&gt;rescueshell-trust-v1&lt;/code&gt;). Our server stores and relays the change and never signs it. From the browser or the CLI you can sign one batch for a group of devices, so a rotation is one step and not a visit to each machine. We hold no shared keys: each provisioning credential belongs to one team, and refresh tokens are stored hashed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gap that remained, and how a signature closed it
&lt;/h2&gt;

&lt;p&gt;Having a trust list is not enough if the relay can still start a session on its own terms. In our earlier design, the relay named a trusted key and an account, and the agent opened a pipe to the device's sshd for it. Public keys are not secret, so a hostile relay could have got that pipe. It could not have authenticated, but it would have reached sshd's pre-auth surface. The threat model keeps this listed as a closed gap.&lt;/p&gt;

&lt;p&gt;Now the agent answers a new session with a fresh nonce and nothing else. It writes a key and dials sshd only when the client returns an SSH signature, in the namespace &lt;code&gt;rescueshell-session-v1&lt;/code&gt;, over a payload that names this device, this session, the account, the host key and the nonce. The key that signs must already be in the device's own trust list. Our servers hold no key, so they cannot answer, and a signature made for one session cannot be reused for another (see &lt;a href="https://rescueshell.com/security/" rel="noopener noreferrer"&gt;https://rescueshell.com/security/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;That is the argument in one mechanism: the relay can ask, and only a key the device already trusts can answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The relay still carries the bytes, so the bytes are yours
&lt;/h2&gt;

&lt;p&gt;A device-held trust list would be weak if the relay could read the shell. It cannot. In the browser, SSH runs in your browser, in a separate signed frame, with your own key, either loaded for one session or saved encrypted by your passkey. With the CLI, native &lt;code&gt;ssh&lt;/code&gt; runs with your own key and the private key never leaves your laptop. The relay forwards encrypted bytes. The agent refuses password sessions, and the device opens no port: it dials out over HTTPS on 443, and the installer refuses a relay address that does not start with &lt;code&gt;https://&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Two more places where the middle could otherwise vouch for something:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The first host key.&lt;/strong&gt; In a tunnel, the first connection often goes through the party you are worried about, so "accept this host key?" is answered by the relay. We do not pin a host key on the relay's word alone. The CLI and the browser pin on first connect only on evidence the relay cannot supply: either you paste the fingerprint the device printed (from the installer or &lt;code&gt;rescueshell-agent --status&lt;/code&gt;), compared whole, or the device attests its host key with a key derived from an enrolment secret that your client made and holds. After that, a change is refused.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Updates.&lt;/strong&gt; Since agent 0.2.3 the agent can update itself, and it keeps the same shape. The trust root is the release signing key baked into the binary. The relay is a courier: every byte is accepted only after &lt;code&gt;SHA256SUMS.sig&lt;/code&gt; verifies against that key and the artifact hash matches. Anything else leaves the running agent untouched. An update changes the code, never who the device trusts. A team can turn automatic updates off, and a single device can opt out with &lt;code&gt;install.sh --no-auto-update&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Not a key alone
&lt;/h2&gt;

&lt;p&gt;The device-side check sits next to the human-side ones. A new team is asked to set up a passkey or authenticator app before its first device, and every new shell asks for it again: a passkey or authenticator code in the browser, an authenticator code or recovery code in the CLI. Then the device wants its fresh signature. If you want a third step, &lt;code&gt;install.sh --ask-password&lt;/code&gt; makes sshd ask the account password after the session key.&lt;/p&gt;

&lt;h2&gt;
  
  
  What stays open
&lt;/h2&gt;

&lt;p&gt;The goal we hold ourselves to is in the threat model: full control of our backend and relay should open zero shells and yield zero key material. The properties above are built and are what the security page lists. The red-team round that would test the goal end to end has not been run, so it is a goal, not a proven result. These residuals are real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A backend or relay owner can still refuse or drop every session. That is availability, not a shell.&lt;/li&gt;
&lt;li&gt;They can still see metadata: who connected where, and when.&lt;/li&gt;
&lt;li&gt;A new install fetches &lt;code&gt;install.sh&lt;/code&gt; from our origin, so a backend owner could serve a bad script to a device being installed at that moment. The agent tarball is signed by a key kept out of the backend. Devices already installed are not affected by a swapped script.&lt;/li&gt;
&lt;li&gt;A compromised web app can still show a fake form that asks you to paste a key. Saved keys and the CLI are the answers to that.&lt;/li&gt;
&lt;li&gt;The attested host-key path is weaker than a paste if the enrolment secret leaks, because the devices of one enrolment pass share that secret. A paste depends on no shared secret.&lt;/li&gt;
&lt;li&gt;Devices on an older agent need one manual install of 0.2.3 before they can update themselves.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs you
&lt;/h2&gt;

&lt;p&gt;Putting the decision on the device puts work on the device and on you. The trust list has to be given at install time. A shell needs a key you hold and a second-factor prompt each time. That is more steps than pasting a password into a jump host, and we think it is worth it, but it is a real cost if your fleet is a handful of machines on a bench.&lt;/p&gt;

&lt;p&gt;It also does not make the service unkillable. If our servers are down or hostile, you cannot get a shell through them. We do not offer an uptime SLA or high availability, and we list that on the security page.&lt;/p&gt;

&lt;p&gt;The longer, gap-by-gap version of this is on &lt;a href="https://rescueshell.com/blog/what-a-reverse-ssh-tunnel-leaves-open/" rel="noopener noreferrer"&gt;the RescueShell blog&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;RescueShell is a remote shell for field devices. Your first device is free to try with no card, and the 30-day trial starts when it connects. Until a card is added, shell traffic is capped at 50 MB in total and a second device needs a card. After that it is €0.10 per device per month, billed yearly, €6 yearly minimum, plus VAT. Hosted in the EU.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://app.rescueshell.com/admin/signup?ref=devto" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>security</category>
      <category>linux</category>
      <category>networking</category>
    </item>
    <item>
      <title>A reconnect schedule is a thundering-herd problem</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Wed, 18 Nov 2026 15:38:52 +0000</pubDate>
      <link>https://dev.to/rescueshell/a-reconnect-schedule-is-a-thundering-herd-problem-1mo3</link>
      <guid>https://dev.to/rescueshell/a-reconnect-schedule-is-a-thundering-herd-problem-1mo3</guid>
      <description>&lt;p&gt;If you have ever been paged because a few thousand devices all came back at once, you know the shape of it. The relay restarts, every socket drops in the same second, and the first thing the fleet does on the way back is line up at the door. The question worth asking is not "how fast should a device reconnect" but "what does the arrival curve at the relay look like for the first two minutes, and who is spread out in it?"&lt;/p&gt;

&lt;p&gt;We worked out that curve for our own device agent by reading its code. The short version: a "safe" minimum delay can line a large share of a fleet up on one value, and we found that in our own backoff. We have not published a measurement of a real relay restart, and this post does not claim one. What follows is read from the agent's code and checked with a simulation of the socket library's backoff.&lt;/p&gt;

&lt;h2&gt;
  
  
  The curve, before the detail
&lt;/h2&gt;

&lt;p&gt;Picture a relay that comes back slow, or falls over again under load. Two schedules meet it. The first wave is half a wall: about half of the devices on the library path scheduled for the same 5 seconds, the rest spread over the next 2.5. The doubling thins it out, until the cap gives half of the stragglers the same 60 second delay again. Underneath, once a minute, a second loop adds its own rebuilds, spread only by when each agent happened to start.&lt;/p&gt;

&lt;p&gt;The rest of this post is why, in the order you would debug it: the clamp, which devices are in the first wave, the loop underneath, and the one case that never retries.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap in a safe minimum
&lt;/h2&gt;

&lt;p&gt;Most reconnect code has a floor, so that a flapping relay does not get hammered. Most also adds jitter, so devices do not move in step. The two interact badly when jitter is applied first and the floor is applied after.&lt;/p&gt;

&lt;p&gt;Our agent asks the socket library for a 5 second first delay, a 60 second cap, and the library's default jitter factor of 0.5. The delay doubles per attempt. Each delay is randomised by up to half either way, then clamped back into 5 to 60 seconds (the library's own backoff code, v3.0.6).&lt;/p&gt;

&lt;p&gt;Jitter pulls about half of the first delays below 5 seconds. The clamp then turns every one of them into exactly 5 seconds. We ran the library's own backoff code 10,000 times with our settings. The first retry landed between 5.0 and 7.5 seconds, and 5,005 of the 10,000 landed on exactly 5,000 ms. After a relay restart, about half the fleet's first attempts are scheduled for the same delay, within whatever spread there was in noticing the drop.&lt;/p&gt;

&lt;p&gt;The cap does the same thing from above. From the fifth retry on, the doubled delay is already 60 seconds, jitter spreads it over 30 to 60, and the clamp puts about half on exactly 60. We saw 5,011, 4,954 and 4,995 of 10,000 for the fifth, sixth and ninth retry. The second to fourth retries are not clamped and are spread out.&lt;/p&gt;

&lt;p&gt;If you run something similar, this is cheap to check: run your backoff function a few thousand times and look for a spike at the floor and at the cap. A histogram that has a tall bar at each end is the clamp.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who is actually in the herd
&lt;/h2&gt;

&lt;p&gt;Not every device takes the same path back, and that matters for how many arrive on the clamped schedule.&lt;/p&gt;

&lt;p&gt;A device holds a session token for ten days (864,000 seconds). The agent gets one each time it starts a connection and hands it to the socket library once. The library re-sends that same token on every reconnect, and the agent has no way to give it a newer one.&lt;/p&gt;

&lt;p&gt;A connected device also goes back to &lt;code&gt;/init&lt;/code&gt; every 24 hours, but that rotates the stored refresh credential only. The token on the wire stays the one from the last connection start, and the relay keeps accepting it because the row it names keeps its identity. So after a relay restart the fleet splits in two:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Session token under ten days old.&lt;/strong&gt; The library reconnects with the token it has. No &lt;code&gt;/init&lt;/code&gt; exchange runs, so the clamped library delay is its only spread. These devices are the herd.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session token older than that.&lt;/strong&gt; The relay refuses it. The device shows as not connected, and the next 60-second tick starts a new connection. That goes through &lt;code&gt;/init&lt;/code&gt; with a throttled-retry wait. If the relay is shedding load it answers &lt;code&gt;temporarily_unavailable&lt;/code&gt;, and the agent waits a random 5 to 60 seconds, up to three times. This wait has no clamp, so it spreads those devices out properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The age that counts is the time since the process last started a connection, not since the device first connected.&lt;/p&gt;

&lt;h2&gt;
  
  
  The second schedule, with no jitter at all
&lt;/h2&gt;

&lt;p&gt;Behind the library sits a plain loop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;60 seconds.&lt;/strong&gt; The agent checks its connection once a minute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5 quick retries.&lt;/strong&gt; If the connection is still gone, it tears it down and rebuilds it from scratch on each of the next ticks, up to five times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;30 minutes.&lt;/strong&gt; After five rebuilds it waits until thirty minutes have passed since the last one, then starts over.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no jitter and no exponential curve. Each agent's ticker starts when the agent starts, so ticks land at different seconds for different devices. That is the only spread this loop has.&lt;/p&gt;

&lt;p&gt;The loop exists to stop a device rebuilding its whole connection every minute forever. Each rebuild closes the previous connection first, so the library's own retries on it end there. After the fifth, the last rebuild is left standing and the loop stays quiet for thirty minutes. What happens next depends on how far that rebuild got. If it had already created its &lt;code&gt;/session&lt;/code&gt; socket, that socket keeps retrying at the capped, jittered pace and brings the device back by itself. If the relay was unreachable at &lt;code&gt;/init&lt;/code&gt;, setup never finished. The &lt;code&gt;/init&lt;/code&gt; socket may reconnect, but it does nothing more, because the connect handler returns until setup is done. That device waits for the thirty-minute mark.&lt;/p&gt;

&lt;h2&gt;
  
  
  One case that deliberately does not retry
&lt;/h2&gt;

&lt;p&gt;If the relay says a device's credential is no good, the agent exits with code 2 instead of retrying. Only a refusal that is not also marked transient counts. A device with a dead credential asking again every minute would be a herd of its own, just a slow one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we do not just tune the numbers
&lt;/h2&gt;

&lt;p&gt;Change a sixty-second cap to ten and you have not tuned one device. You have changed the load on your relay from every device at once, on the next release. You cannot roll that back from the relay, because the devices you would need to reach are the ones running the change.&lt;/p&gt;

&lt;p&gt;That is why we treat these numbers as a fleet contract, not a setting. Changing them is a load test you plan. If the fleet grew, the two things we would change first are a lower floor or our own jitter for the library, and jitter for the loop.&lt;/p&gt;

&lt;p&gt;The full write-up, with the same numbers, is on &lt;a href="https://rescueshell.com/blog/reconnect-schedule-is-a-thundering-herd-problem/" rel="noopener noreferrer"&gt;our blog&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;RescueShell is a remote shell for field devices. Your first device is free to try with no card, and the 30-day trial starts when it connects. Until a card is added, shell traffic is capped at 50 MB in total and a second device needs a card. After that it is €0.10 per device per month, billed yearly, €6 yearly minimum, plus VAT. Hosted in the EU.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://app.rescueshell.com/admin/signup?ref=devto" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;&lt;/p&gt;

</description>
      <category>embedded</category>
      <category>linux</category>
      <category>networking</category>
      <category>go</category>
    </item>
    <item>
      <title>Why our agent is not a VPN</title>
      <dc:creator>RescueShell</dc:creator>
      <pubDate>Fri, 13 Nov 2026 21:32:00 +0000</pubDate>
      <link>https://dev.to/rescueshell/why-our-agent-is-not-a-vpn-3l0l</link>
      <guid>https://dev.to/rescueshell/why-our-agent-is-not-a-vpn-3l0l</guid>
      <description>&lt;p&gt;&lt;em&gt;First published on the &lt;a href="https://rescueshell.com/blog/why-our-agent-is-not-a-vpn/" rel="noopener noreferrer"&gt;RescueShell blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The first question a customer's IT department asks is "is this a VPN?". The honest answer is no,&lt;br&gt;
and the reasons are the whole design.&lt;/p&gt;

&lt;h2&gt;
  
  
  A VPN joins networks. We join one shell.
&lt;/h2&gt;

&lt;p&gt;A VPN puts two networks on one fabric. Once it is up, anything on one side can try to reach&lt;br&gt;
anything on the other. Firewall rules then try to take that back.&lt;/p&gt;

&lt;p&gt;Our agent does the opposite. It opens one outbound connection to our relay, over TLS on port 443,&lt;br&gt;
and holds it. It opens no port on the device. It adds no route. It needs no &lt;code&gt;tun&lt;/code&gt; device and no&lt;br&gt;
kernel module. There is nothing on the customer's network for anyone else to reach.&lt;/p&gt;

&lt;p&gt;When an engineer wants a shell, the relay asks the device to join one session for one person.&lt;br&gt;
The shell travels over a second outbound connection to the same relay, opened for that session.&lt;br&gt;
When the session ends, that connection closes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who can get in, and how we check
&lt;/h2&gt;

&lt;p&gt;Every step names a person and a device:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The engineer logs in to the relay. The relay reads their role from the database on every
request, not from an old token.&lt;/li&gt;
&lt;li&gt;The relay checks that the engineer's team owns the device, and that their role allows a shell.
There are four roles: viewer, operator, admin, owner.&lt;/li&gt;
&lt;li&gt;The relay creates a session with a short-lived code, stored hashed.&lt;/li&gt;
&lt;li&gt;The device's own OpenSSH server checks the key. The device keeps its own list of trusted keys
and accounts, and our servers cannot add to it. With our CLI the key is the engineer's own SSH
key, and the private key stays on their laptop. With the browser shell, SSH runs in the browser
with the engineer's own key, and the relay only forwards encrypted bytes. The agent refuses
password sessions.&lt;/li&gt;
&lt;li&gt;The device's host key must match the one it reported the first time. If it changes, shells are
refused until an admin accepts the new key. The CLI and the browser shell check it too, against
the fingerprint the engineer pasted from the device.&lt;/li&gt;
&lt;li&gt;The session is logged: who, which device, when.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remove someone from the team, or demote them to viewer, and their open shells end right away.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the customer's IT sees
&lt;/h2&gt;

&lt;p&gt;One outbound HTTPS connection from one device they did not buy, to one host, plus a second to the&lt;br&gt;
same host while a shell is open. That is it.&lt;/p&gt;

&lt;p&gt;No inbound rule. No new subnet. No client on their laptops. No change on their side when we add an&lt;br&gt;
engineer or lose one. If they block the connection, we lose the shell, and nothing else of theirs&lt;br&gt;
changes.&lt;/p&gt;

&lt;p&gt;That is the sentence that gets through a security review: one shell, on one machine we shipped,&lt;br&gt;
for one engineer we authorised, with a record of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;p&gt;We would rather say this up front:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is not a mesh VPN. The tunnel only reaches the device's SSH server. Once you have a shell,
the device is still a machine on their network, so their network rules still apply to it.&lt;/li&gt;
&lt;li&gt;No session recording. The log says who and when, not what they typed.&lt;/li&gt;
&lt;li&gt;No uptime SLA, no SOC 2, no high availability.&lt;/li&gt;
&lt;li&gt;It needs OpenSSH on the device. Dropbear is not supported.&lt;/li&gt;
&lt;li&gt;It connects directly and does not use an HTTP proxy. A network where web traffic only leaves
through a proxy will not work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need to reach a whole site network, a VPN is the right tool. If you need a shell on the&lt;br&gt;
machine you shipped, this is less to approve.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;RescueShell: €0.10 a device a month, billed yearly, at least €6 a year, plus VAT. Thirty-day&lt;br&gt;
trial, card required, and the clock starts when your first device connects. Hosted in the EU,&lt;br&gt;
&lt;a href="https://rescueshell.com/legal/eu-residency/" rel="noopener noreferrer"&gt;exceptions listed&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.rescueshell.com/admin/signup?ref=devto" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;&lt;/p&gt;

</description>
      <category>embedded</category>
      <category>linux</category>
      <category>security</category>
      <category>networking</category>
    </item>
  </channel>
</rss>
