News for hackers. Stuff that matters.
Re:Port 0: The Port That Does Not Exist by skinfaxi on Saturday November 07, 2026 @05:36AM (#50403317)
Seems hugged?
Re:Port 0: The Port That Does Not Exist by greggsy on Saturday November 07, 2026 @06:37AM (#50403653)
I saw the URL and immediately thought it was about Acid Pro DAW or Vegas video editor is used to use back in the early 00’s.
Re:Port 0: The Port That Does Not Exist by embedding-shape on Saturday November 07, 2026 @06:54AM (#50403755)
[delayed]
Re:Port 0: The Port That Does Not Exist by Joker_vD on Saturday November 07, 2026 @09:38AM (#50404931)
And then there is OpenSSH...

    joker@joker:~$ ssh localhost -D 127.0.0.1:0
    Bad dynamic forwarding specification '127.0.0.1:0'
    joker@joker:~$ ssh localhost -D 127.0.0.1:9999
    ssh: connect to host localhost port 22: Connection refused
    joker@joker:~$ ssh localhost -L 127.0.0.1:0:localhost:8080
    Bad local forwarding specification '127.0.0.1:0:localhost:8080'
    joker@joker:~$ ssh localhost -L 127.0.0.1:9999:localhost:8080
    ssh: connect to host localhost port 22: Connection refused
Oh well.
Re:Port 0: The Port That Does Not Exist by wolrah on Saturday November 07, 2026 @10:25AM (#50405338)
> I'm not sure how I'd do acceptance/E2E testing without the magic of port 0.

Same as anything else, an explicit flag to achieve the same "just give me a port" functionality as this "magic number" does without resulting in the documented unpredictable behavior around a technically legitimate port number.

As the article points out, most if not all of the services exposed on port 0 seem to be accidental and likely resulted from people assuming this magic behavior applies everywhere instead of just to one specific API.

Re:Port 0: The Port That Does Not Exist by embedding-shape on Saturday November 07, 2026 @10:50AM (#50405544)
> Same as anything else

Yeah, obviously I'm a programmer so I'm well aware it's technically possible, it was a bit of an exaggeration to explain how much value I feel I get from it.

> most if not all of the services exposed on port 0 seem to be accidental

No program actually end up "exposed on port 0", if it's not supported it won't be able to create a listener on that port, AFAIK. Most yeah, all no. P2P software commonly leverage port 0, and other "discover<>connect" types of software. But I'd agree that it's most likely accidental if outside of those niches.

Re:Port 0: The Port That Does Not Exist by wolrah on Saturday November 07, 2026 @12:29PM (#50406308)
> No program actually end up "exposed on port 0"

Clearly you didn't read the article, plenty of stuff is in fact exposed on actual port 0 because it's a real thing and not just a way to get whatever ephemeral port like you're using.

Re:Port 0: The Port That Does Not Exist by afn on Saturday November 07, 2026 @07:00AM (#50403788)
Re:Port 0: The Port That Does Not Exist by 99harry on Saturday November 07, 2026 @08:43AM (#50404468)
Sometimes I have scripts that automatically assign ports starting from 30000. How would that work? Would I have to bind to port 0 multiple times until I randomly get a port in that range?
Re:Port 0: The Port That Does Not Exist by 0bytes on Saturday November 07, 2026 @09:25AM (#50404813)
I’m not exactly sure if that’s the question, but the range can be set. Here’s the Linux solution: https://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edi... FreeBSD has net.inet.ip.portrange
Re:Port 0: The Port That Does Not Exist by 99harry on Saturday November 07, 2026 @10:12AM (#50405234)
That might not quite fit my use case. My AI-generated scripts probably won't modify system-level configuration files to change the port range
Re:Port 0: The Port That Does Not Exist by Zambyte on Saturday November 07, 2026 @10:43AM (#50405482)
... do you not have a say in the matter?
Re:Port 0: The Port That Does Not Exist by _flux on Saturday November 07, 2026 @10:29AM (#50405365)
I'm not quite sure what a script assigning ports actually does, but if I need an app to bind a port in some port range, I just start binding ports starting from 30000 until it succeeds.

If it's in a script then that might be difficult, but a racy approximation could be to loop e.g. listening socat with different ports for finding the free port. (Or maybe: parse output of ss.) But if the port use is separate from the port binding, then it might still be busy once the time to rebind it comes.

Re:Port 0: The Port That Does Not Exist by justsomehnguy on Saturday November 07, 2026 @10:35AM (#50405425)
I have a feeling what sometimes :0 is interpreted as a 'first listening'. But Occam says what most of the time it's just 'DNAT dst port ANY to :80' or whatever, no magik.
Re:Port 0: The Port That Does Not Exist by fosco on Saturday November 07, 2026 @10:50AM (#50405548)
Re:Port 0: The Port That Does Not Exist by OptionOfT on Saturday November 07, 2026 @11:00AM (#50405636)
> And asking for port 0 needs no privileges.

My brain has issues with this kind of form. It prevents me from reading words in a fifo manner. I now need to backtrack, because the 'no' negates the word before.

Re:Port 0: The Port That Does Not Exist by digitalsushi on Saturday November 07, 2026 @11:14AM (#50405727)
legit curious, if you read 'zero privileges' does it parse easier
Re:Port 0: The Port That Does Not Exist by OptionOfT on Saturday November 07, 2026 @11:24AM (#50405798)
It parses easier, but it's still doing extra work to negate the 'needs'.

doesn't need privileges > needs zero privileges > needs no privileges

Re:Port 0: The Port That Does Not Exist by kevin_thibedeau on Saturday November 07, 2026 @01:07PM (#50406622)
"No" here doesn't negate needs. It is part of a subordinate clause "no privileges". Substitute with "nothing" (literally, no thing) for the same parse.
Re:Port 0: The Port That Does Not Exist by justsomehnguy on Saturday November 07, 2026 @01:55PM (#50406973)
Agree.

    "Give me a 4 apples."
    "Give me a 999 apples."
    "Give me a 0 apples."
The last one doesn't say "do not give me apples" and it surely doesn't say "do not give me a zero apples".
Re:Port 0: The Port That Does Not Exist by spacechild1 on Saturday November 07, 2026 @11:35AM (#50405866)
FWIW this is exactly how you negate a verb in German. For example: "Ich rauche nicht " -> "I don't smoke" or "Ich brauche keinen Mantel" -> "I don't need a coat"
Re:Port 0: The Port That Does Not Exist by Muskwalker on Saturday November 07, 2026 @12:11PM (#50406153)
English |-n't| is also a negation that applies to what comes before. In fact I don't think you actually can put a verbal negation before the verb in English in ordinary/modern circumstances; only a few verbs can be directly negated, and if one of those isn't present, one is added (usually "do", this is called "do-support") ... and the negation goes after it.

"This is how you negate a verb" -> "This is not how you negate a verb" ('is' can be negated, the negation goes after)

"This confuses the duke" -> "This does not confuse the duke" ('confuses' wants do-support to negate it, and the negation goes after 'do'.)

Re:Port 0: The Port That Does Not Exist by spacechild1 on Sunday November 08, 2026 @11:04AM (#50414405)
You are right. However, I would argue that semantically the "do" is part of the negation.

Actually, you can do the same in German ("Ich tu nicht essen" -> "I do not eat"), but it's very colloquial and "forbidden" in writing. The proper form is "Ich esse nicht".

Re:Port 0: The Port That Does Not Exist by seritools on Saturday November 07, 2026 @11:40AM (#50405901)
"doesn't need any privileges" is more tokens :^)
Re:Port 0: The Port That Does Not Exist by wgd on Saturday November 07, 2026 @08:51PM (#50409807)
Recently Claude and GPT have either both acquired this tic or I've become hypersensitive to it but it's just unbearable and it turns out that an editing pass which forbids "X verbs no noun" constructions will basically always improve a piece of writing. If I could only pick one construct to ban I'd probably choose it even over the classic "not X but Y".