<?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: Qian_Xiao</title>
    <description>The latest articles on DEV Community by Qian_Xiao (@pbxqdown).</description>
    <link>https://dev.to/pbxqdown</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%2F4121297%2F1ec7112f-7c6b-4e65-a6f4-eface667d4f5.jpg</url>
      <title>DEV Community: Qian_Xiao</title>
      <link>https://dev.to/pbxqdown</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pbxqdown"/>
    <language>en</language>
    <item>
      <title>Everything was running. The port belonged to the wrong process.</title>
      <dc:creator>Qian_Xiao</dc:creator>
      <pubDate>Fri, 11 Sep 2026 18:24:59 +0000</pubDate>
      <link>https://dev.to/pbxqdown/everything-was-running-the-port-belonged-to-the-wrong-process-3e1i</link>
      <guid>https://dev.to/pbxqdown/everything-was-running-the-port-belonged-to-the-wrong-process-3e1i</guid>
      <description>&lt;p&gt;My browser sat there spinning on "connecting".&lt;/p&gt;

&lt;p&gt;The setup is common enough: &lt;code&gt;x11vnc&lt;/code&gt; shares a screen on port 5900, and&lt;br&gt;
&lt;code&gt;websockify&lt;/code&gt; forwards to it so a browser can connect. I checked the services.&lt;br&gt;
websockify was running. Everything was running. Nothing worked.&lt;/p&gt;

&lt;p&gt;The question I actually needed answered was simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who is using port 5900?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's normally &lt;code&gt;ss -ltnp&lt;/code&gt; or &lt;code&gt;lsof -i :5900&lt;/code&gt;, and neither was installed on that&lt;br&gt;
box — which is why I'd written a small tool for this one question:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ portclue 5900
NOT EXPOSED LOCALLY

TCP port 5900

  127.0.0.1:5900/tcp  [NOT_EXPOSED_LOCALLY]
    -&amp;gt; LISTEN             ... bound to 127.0.0.1:5900/tcp
    -&amp;gt; OWNED              PID 1087636 (x11vnc), systemd unit session-1911.scope
    -&amp;gt; LOOPBACK_ONLY      127.0.0.1 is reachable only from this network namespace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An &lt;code&gt;x11vnc&lt;/code&gt; had the port — just not the one I'd started. It was a leftover from&lt;br&gt;
a session days earlier that had never shut down, so the new one could never get&lt;br&gt;
the port, and websockify had been faithfully forwarding to a dead screen the&lt;br&gt;
whole time.&lt;/p&gt;

&lt;p&gt;(PortClue gave me the PID. &lt;code&gt;ps&lt;/code&gt; is what confirmed the process was far older than&lt;br&gt;
everything around it — the tool doesn't report process age yet.)&lt;/p&gt;

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

&lt;p&gt;Same facts &lt;code&gt;ss&lt;/code&gt; would give you, but written out instead of encoded.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;127.0.0.1&lt;/code&gt; isn't a number you have to interpret; it says "reachable only from&lt;br&gt;
this network namespace". On a port bound to &lt;code&gt;0.0.0.0&lt;/code&gt; it says &lt;code&gt;ALL_INTERFACES&lt;/code&gt;,&lt;br&gt;
then reads your nftables or iptables rules to see whether anything is actually&lt;br&gt;
allowed through. If it can't read them, it says &lt;code&gt;UNKNOWN&lt;/code&gt; instead of guessing.&lt;/p&gt;

&lt;p&gt;It gets all of that without &lt;code&gt;ss&lt;/code&gt; or &lt;code&gt;lsof&lt;/code&gt; installed, by asking the kernel&lt;br&gt;
directly.&lt;/p&gt;

&lt;p&gt;It's read-only: it never connects to the port you ask about, and it can't kill&lt;br&gt;
anything. Scope is Linux TCP listeners — that's the whole promise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/pbxqdown/portclue/v0.1.2/scripts/install.sh | sh

portclue        &lt;span class="c"&gt;# everything listening&lt;/span&gt;
portclue 5900   &lt;span class="c"&gt;# one port, explained&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/pbxqdown/portclue" rel="noopener noreferrer"&gt;https://github.com/pbxqdown/portclue&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>debugging</category>
      <category>devops</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
