<?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: Viktor</title>
    <description>The latest articles on DEV Community by Viktor (@viktor_9132305bf4ca8f79ae).</description>
    <link>https://dev.to/viktor_9132305bf4ca8f79ae</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%2F3420904%2F47aa05d0-15ef-4b6b-a868-06ca4e3e841f.webp</url>
      <title>DEV Community: Viktor</title>
      <link>https://dev.to/viktor_9132305bf4ca8f79ae</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/viktor_9132305bf4ca8f79ae"/>
    <language>en</language>
    <item>
      <title>Share a shell over your LAN in one command — no SSH setup</title>
      <dc:creator>Viktor</dc:creator>
      <pubDate>Thu, 02 Jul 2026 02:08:43 +0000</pubDate>
      <link>https://dev.to/viktor_9132305bf4ca8f79ae/share-a-shell-over-your-lan-in-one-command-no-ssh-setup-3p33</link>
      <guid>https://dev.to/viktor_9132305bf4ca8f79ae/share-a-shell-over-your-lan-in-one-command-no-ssh-setup-3p33</guid>
      <description>&lt;p&gt;I kept hitting the same wall: I'm on my laptop, I need a shell on my desktop across the room for one quick thing, and standing between me and that shell is the whole SSH ritual — enable &lt;code&gt;sshd&lt;/code&gt;, generate a key, copy it into &lt;code&gt;authorized_keys&lt;/code&gt;, remember the IP, get the firewall out of the way. Five minutes of yak-shaving for thirty seconds of work.&lt;/p&gt;

&lt;p&gt;So I made &lt;a href="https://github.com/viktor-silakov/cmux-ssh-here" rel="noopener noreferrer"&gt;&lt;code&gt;cmux-ssh-here&lt;/code&gt;&lt;/a&gt;. One command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx cmux-ssh-here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It spins up a throwaway, token-authenticated SSH server on the machine you run it on, and prints a link plus a QR code. Open the link on another Mac and &lt;a href="https://cmux.com" rel="noopener noreferrer"&gt;cmux&lt;/a&gt; drops you straight into a shell. Hit &lt;code&gt;Ctrl-C&lt;/code&gt; and the server, the token, and the host key all vanish — nothing is left running, nothing is left on disk.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it actually does
&lt;/h2&gt;

&lt;p&gt;The dashboard it prints gives you a few ways in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;cmux deep link&lt;/strong&gt; (&lt;code&gt;https://cmux.com/deeplink/ssh?...&lt;/code&gt;) — one click, straight into a shell inside cmux.&lt;/li&gt;
&lt;li&gt;A plain &lt;strong&gt;&lt;code&gt;ssh user@host -p port&lt;/code&gt;&lt;/strong&gt; command — for any client on any OS.&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;&lt;code&gt;ssh://&lt;/code&gt; deep link&lt;/strong&gt; — for mobile SSH apps that support it (Termius, Blink, WebSSH).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two QR codes&lt;/strong&gt; so you can scan from a phone.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;countdown bar&lt;/strong&gt; for the link's lifetime and a list of who's connected.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It runs its own SSH server (via &lt;a href="https://github.com/mscdex/ssh2" rel="noopener noreferrer"&gt;&lt;code&gt;ssh2&lt;/code&gt;&lt;/a&gt;) with an &lt;strong&gt;ephemeral host key&lt;/strong&gt; — generated at startup, gone at exit.&lt;/li&gt;
&lt;li&gt;Auth is a &lt;strong&gt;token that rides in the link's &lt;code&gt;user=&lt;/code&gt; field&lt;/strong&gt;. The server accepts only that token and &lt;strong&gt;rotates it every 3 minutes&lt;/strong&gt;, so a link someone copied earlier goes stale on its own.&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;tmux&lt;/code&gt; present, the interactive shell runs inside it, so sessions survive disconnects and are shared across connections.&lt;/li&gt;
&lt;li&gt;It ships a real PTY shell plus an exec channel and SFTP, which is what lets cmux bootstrap its remote helper — a shell-only server isn't enough.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The security model, honestly
&lt;/h2&gt;

&lt;p&gt;The token in the link is a &lt;strong&gt;bearer secret that grants a shell as your user&lt;/strong&gt;. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use it on a &lt;strong&gt;trusted local network only&lt;/strong&gt;. The server binds to &lt;code&gt;0.0.0.0&lt;/code&gt;, so anyone on your LAN who has the token can connect while it's live.&lt;/li&gt;
&lt;li&gt;Don't paste the link into untrusted channels.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;--once&lt;/code&gt; to lock the link to the &lt;strong&gt;first device that connects&lt;/strong&gt; and reject everyone else.&lt;/li&gt;
&lt;li&gt;The 3-minute rotation limits the blast radius of a leaked link; live sessions stay connected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's deliberately a "quick trusted-LAN access" tool, not an expose-your-box-to-the-internet tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Options
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx cmux-ssh-here &lt;span class="nt"&gt;--once&lt;/span&gt;            &lt;span class="c"&gt;# single-use: locks to the first device&lt;/span&gt;
&lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2222 npx cmux-ssh-here         &lt;span class="c"&gt;# fixed port (random by default)&lt;/span&gt;
&lt;span class="nv"&gt;CMUX_SSH_TTL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;600 npx cmux-ssh-here  &lt;span class="c"&gt;# token lifetime in seconds (default 180)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When I reach for it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Grab a shell on my desk machine from the couch, from another Mac on the same Wi-Fi.&lt;/li&gt;
&lt;li&gt;Hand a teammate a shell for quick pairing — &lt;code&gt;--once&lt;/code&gt; so only they get in.&lt;/li&gt;
&lt;li&gt;Debug a box I don't want to permanently open &lt;code&gt;sshd&lt;/code&gt; on. Close the terminal, the door is gone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;macOS and Linux hosts are supported (it needs a POSIX shell). Node 18+.&lt;/p&gt;

&lt;p&gt;Repo, source, and issues: &lt;strong&gt;&lt;a href="https://github.com/viktor-silakov/cmux-ssh-here" rel="noopener noreferrer"&gt;https://github.com/viktor-silakov/cmux-ssh-here&lt;/a&gt;&lt;/strong&gt; — MIT. Feedback on the token model especially welcome; if it saves you the SSH dance, a star helps others find it.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>ssh</category>
      <category>macos</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
