Back

How SSH port became 22 (2017)

408 points6 monthsssh.com
teddyh6 months ago

> I designed SSH to replace both telnet (port 23) and ftp (port 21).

As I have written here previously¹, that’s actually a bit of revisionist history, or at least a significant omission. Speaking as someone who was actually using Unix systems when this happened, the "ssh" command was replacing the rsh command, and also still ships an "slogin" command, replacing rsh’s companion command, "rlogin" (and "scp" replaced "rcp"). Where I was, nobody was even using telnet or FTP internally; everybody was using rsh, rlogin and rcp! This also better explains the naming; going from "rsh" to "ssh" is easier.

If someone had wanted to make telnet encrypted, they would just have had to implement the standard telnet protocol and add another option in the protocol; it has a bunch already, and even one for encryption, IIRC.

1. <https://news.ycombinator.com/item?id=14178333>

throw0101c6 months ago

> If someone had wanted to make telnet encrypted, they would just have had to implement the standard telnet protocol and add another option in the protocol […]

    This document describes a the telnet encryption option as a generic
    method of providing data confidentiality services for the telnet data
    stream.  While this document summarizes currently utilized encryption
    types and codes, it does not define a specific encryption algorithm.
    Separate documents are to be published defining implementations of
    this option for each encryption algorithm.
* https://datatracker.ietf.org/doc/html/rfc2946
teddyh6 months ago

So I did recall correctly, then.

kloch6 months ago

> Speaking as someone who was actually using Unix systems when this happened, the "ssh" command was replacing the rsh command,

A different data point: I was also a Unix sysadmin at the time (thought just out of school) and for me ssh replaced telnet and ftp. I never used rsh, rlogin, and rcp except when testing exploits.

teddyh6 months ago

In my experience, telnet and FTP were used when accessing external resources; when wandering around the local menagerie of machinery, rsh, rlogin and rcp were predominant.

QuercusMax6 months ago

Telnet predates UNIX and came from the late 60s; rsh/rlogin were introduced by BSD in the 80s. So if you were in a BSD-derived system, you might have used rsh/rlogin, but otherwise telnet was the standard. Telnet was also cross-platform; I first used it on VMS.

linsomniac6 months ago

Ditto, I had been doing sysadmin as my job for a few years in 1995 and as a component of my job or as a hobby for ~5 years before that. I was decidedly a telnet/ftp guy before ssh, and dabbled a little with "ssltelnet". I mostly avoided rsh and family because I didn't love the security model.

SSH was a fantastic improvement at the time, though the whole licensing model interfered with my use for the first several years.

Accujack5 months ago

My experience as well.

Much depends on whether your systems were running BSD-style RPC services.

LeFantome5 months ago

He included the letter he wrote to IANA so, unless you are calling fraud, it is actual history rather than revisionist history.

In that letter he says: “It provides major improvements in security and functionality over existing telnet and rlogin protocols”.

So, while you are correct about rsh, it seems totally fair ( and likely just correct ) for him to say he chose port 22 for its proximity to telnet. Also, since SSH includes SFTP, what he says about FTP checks out as well.

The story is about “why 22” and telnet answers that question better than rsh does. I guess if the question was “why ssh”, the details you added would matter more.

falqun5 months ago

Without having any specific information on the matter at hand: revisionist history does not need fabricated facts. Its very possible to revision history by omitting crucial parts. Hence the letters might be genuine and someone revisions history by leaving out other relevant information.

NelsonMinar6 months ago

Oh, rsh, your security model was so cute. It runs on port 513. (There is also rexec, port 512, and rcp on port 514. rlogin runs on port 513 along with rsh.)

midtake5 months ago

I think it's a bit unfair to call it revisionist. It's a direct claim by the author of ssh, and out of all the ports numbered 1-255, telnet (23) does come closest in function to ssh. I believe the article is more about how lucky the author got to nestle a port between two other protocols that ssh superseded, rather than the thinking behind the naming of the ssh family of protocols.

mistrial96 months ago

Berkeley compute facilities used $rsh and $rlogin .. not clear on the file transfer from the outside. Dial-up modem from a residential phone line in those days, this was before 9600 baud became common for individuals.

ftp on the other hand was more like finger or similar.. going to some external site that was public, or had a login to distribute files.

acer46666 months ago

"The -p <port> option can be used to specify the port number to connect to when using the ssh command on Linux. The -P <port> (note: capital P) option can be used with SFTP and scp."

The most annoying thing about SSH/scp!

blensor6 months ago

What's even more annoying is that -P for scp has to be put before the target while -p for the ssh client I am using can be put after the target.

So when you write your scp command and then realize you forgot to put in the port you have to go back and put it before the target.

deaddodo6 months ago

The most annoying thing about SCP is args ordering, I would have preferred a single direction arg for transfer details, if it meant we didn't have to worry about positional args.

Then again, I'm speaking as someone that came into the scene well after development, so that could just be annoyance via naivete.

hsbauauvhabzb6 months ago

Use ~/.ssh/config to add per host or wildcard values for port :)

DiggyJohnson6 months ago

~/.ssh/config is one of the simplest, most useful features I use on a daily basis. It would be easy to accomplish much of it's behavior even if it didn't exist (bash script for each account@host), but it wouldn't be as elegant.

The config-aware shell completion is especially cool.

hsbauauvhabzb5 months ago

My most recent pet hate is inability to instruct scp to ignore symlinks -.-

+1
phlummox5 months ago
bombcar6 months ago

This right here is the next big trick behind using CTRL+R to find the last ssh command.

zamadatix5 months ago

Great if you only ever ssh from your primary box/profiles, an amplifier of the problem (due to entering the commands less often) otherwise!

tracker15 months ago

I use this for aliasing as much as for Port assignment.

atribecalledqst6 months ago

This tripped me up hardcore at work recently, because I was trying to SSH into a VM using a non-standard port, but the port-forwarding went from the non-standard port into the usual 22 on the VM. So when I got "Connection Refused" on port 22, I thought that meant the connection was getting through the NAT layer but then failing at the VM for some reason.

NOPE I'd just specified the option wrong!

dijit6 months ago

I always just use -o port=<xx> for this reason.

lnxg33k16 months ago

I use rsync with -e 'ssh -p PORT', so that I can also have the ability to resume just in case :D, interesting how everyone has a different solution ^^, let's see how many ways of doing the same thing can we collect in this thread

lloeki6 months ago

Another one is places where you can use `user@host` and those where you can't and have to use `-l user` (and thus have to use `-e 'ssh -l user'` or equivalent)

Usually I use per host `ssh_config(5)` (both for port and user) but some tools also don't make use of that!

jbaber6 months ago

Wait, lower case 'o' works?

ryan-duve6 months ago

Looks like I've got BSD SSH installed. From `man ssh`:

     -o option
             Can be used to give options in the format used in the configura‐
             tion file.  This is useful for specifying options for which there
             is no separate command-line flag.  For full details of the op‐
             tions listed below, and their possible values, see ssh_config(5).
`Port` is on the list underneath. So I think the idea is you run

    ssh -o <option_name> <option_value>
where the first can be `--port`. This looks like it will be really handy for me for the exact reason GP said.
rnts086 months ago

Even more fun when you are doing ssh, scp and throw in some random nmap in there as well, where -P and -p are both used.

mpcjanssen6 months ago

Add the lowercase -r for recursive scp and you have two screens with man pages open.

codegeek6 months ago

Agreed :). I always have to google which case applies where as I use ssh and scp heavily.

joak6 months ago

Announced officially to the mythical cypherpunks@toad.com mailing list...

Fighting to legalize cryptography on the internet. PGP was banned. Sending encrypted emails was illegal...

Cypherpunks won. Thanks to them.

tptacek6 months ago

Where were you that PGP was banned, or encrypting emails was illegal?

mratsim6 months ago

Cryptography was considered a war weapon and only allowed for military use.

The United States had to be brought to court to finally allow cryptography: https://en.m.wikipedia.org/wiki/Bernstein_v._United_States

> Years before, the government had placed encryption, a method for scrambling messages so they can only be understood by their intended recipients, on the United States Munitions List, alongside bombs and flamethrowers, as a weapon to be regulated for national security purposes. Companies and individuals exporting items on the munitions list, including software with encryption capabilities, had to obtain prior State Department approval. — Electronic Frontier Foundation: EFF's History

Before that, export rules could be "worked around" by printing cryptography in books.

See also https://en.m.wikipedia.org/wiki/Export_of_cryptography_from_...

lloeki6 months ago

> Cryptography was considered a war weapon

It still is.

e.g in France:

https://cyber.gouv.fr/en/protection-sensitive-and-restricted...

    This legal framework has been introduced in 2011 in order to protect facilities, knowledge, savoir-faire, information which, if intercepted, could:
    
    - Affect French economic interests (risk 1);
    - Reinforce military capacities of other country or weaken French military capacities (risk 2);
    - Lead to the proliferation of weapons of mass destruction in nuclear, ballistic, chemical or biological fields;
    - Lead to the development of terrorist activities on French territory or abroad.
It's just that import/export constraints have been relaxed.

See Annexe 1 here: https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000646995?...

This is one of the reasons why MobiusSync is not available in the French iOS App Store since it doesn't use iOS crypt which already has approval plus it doesn't fit into some of the exceptions to the restrictions, so they'd have to fill in paperwork which is only available in French and submit via snail mail (go figure, although they do accept answers written in English as a courtesy).

https://github.com/MobiusSync/MobiusSync/issues/27

Similar concerns, processes, and exceptions are effective for other countries, e.g for the U.S. you need Encryption Registration (ERN) approval from the U.S. Bureau of Industry (BIS). Exceptions are described in Category 5, Part 2 of the U.S. Export Administration Regulations.

deaddodo6 months ago

That's an oversimplification and also inferring a completely incorrect situation.

It was perfectly fine for American citizens to use cryptography amongst each other or with outside nationals. It was also completely fine to download and use externally developed software.

What was illegal was developing and exporting cryptographic software. This is why, for the longest time, you would see warnings on web pages (puTTy, for instance) saying the software was only intended for use in the United States.

KMnO46 months ago

I remember publishing some apps to the iOS App Store and was asked to “declare cryptography to the US government”. I’m not even American.

The form made it clear that using HTTPS is considered cryptography, so I’m fairly sure almost every app on the store has checked “yes” to that question.

+2
mratsim6 months ago
tptacek6 months ago

So far as I'm aware, this was never the case. Bernstein's case started in 1995 (it was decided in 1999). I assure you, cryptographic software was widespread and, apart from export controls, unchecked in 1995. Source: my professional career started in 1995.

In (I think) early 1995 I bought a "This T-Shirt Is A Munition" shirt with RSA source code on it, by typing the information from the bottom of a personal check(!) into a web page. It was a whole thing.

cjbprime6 months ago

"You have to get an export license if you're distributing from inside the US to outside the US" is pretty different to "sending encrypted emails was illegal", no?

For one thing, it sounds like sending wasn't impacted at all, once you had the software.

+3
mratsim6 months ago
TedDoesntTalk6 months ago

Sending encrypted email in the US was NOT illegal. Sharing encryption libraries was.

+2
mratsim6 months ago
tiernano6 months ago

not quite crypto related, or at least directly, i remember this old Mac G4 ad: https://youtu.be/lb7EhYy-2RE?si=3tvJK4BXbA71LbGQ

jeroenhd6 months ago

Encryption was (and in some countries, still legally is) considered dual use technology. You needed to go through paperwork and licensing to export cryptography across the border. Symmetric keys longer than 64 bits were considered too strong.

This led to all kinds of stupidity. Internet Explorer shipped with nerfed TLS capabilities, limiting key sizes to 40 bits or 56 bits depending on the version.

When the encryption laws changed in 2000, Microsoft allowed users to download an update to improve SSL encryption: https://learn.microsoft.com/en-us/previous-versions/tn-archi...

You could legally encrypt emails, of course, as long as you kept the key sizes small and didn't export the encryption software to another country.

If you sell and export encryption products from the USA (and a bunch of other countries, see the Wassenaar Accords) to certain places (including China and Russia), you're still obligated to register your product if you use modern key sizes. I'm not sure if governments still care now that OpenSSL and PGP are freely available to anyone, but if your proprietary email encryption program is found on North Korean computers, your government may ask you some uncomfortable questions.

atoav6 months ago

You are probably from the US and not aware how things looked outside of it? https://en.m.wikipedia.org/wiki/Crypto_Wars

sjamaan6 months ago

Quite recently, the researchers behind the Tetraburst attack (https://www.tetraburst.com/) discovered that Tetra's encryption has "levels" which depend on the intended recipient's country.

This leaves the critical infrastructure of emergency services and police force for a lot of countries (notably, US non-allies) wide open to attack.

rsynnott6 months ago

The existence of the levels was previously known; what they discovered was just how bad some of them are.

michaelt6 months ago

PGP was not exactly banned but if you were in Europe when ITAR restricted its export, and you were trying to download from strait-laced corporate types like AOL, they wouldn't let you.

And even if a determined person could get around the blocks, they severely limited the network effects; office workers on their employers' PCs weren't going to be getting encryption software from IRC bots to bypass arms export laws.

Some time towards the late 90s PGP became much more easily available.

graemep6 months ago

Its effects are still with us. Hardly anyone uses encrypted email even though it is now easy to set up. The (lack of) network effects has persisted.

SAI_Peregrinus6 months ago

IMO that's less due to the ease of setup and more due to the lack of any sane key exchange system & general impossibility of encrypting all email content (e.g. subject line).

sliken6 months ago

As discussed on thread, not banned, but posting it somewhere could get you in significant trouble. In fact, Phil Zimmermann got in quite a bit of trouble for his contribution towards the world getting a hold of PGP, which was considered a export restricted munition. I believe there was at least one court case, harassment, tax audit, and hassle at the border. My memory is a big vague, but you get the idea.

I was at codecon, forget if Zimmerman was there, or just quoted. His story was recounted, then someone else who attended codecon and mentioned releasing ITAR restricted crypto. They were part of a leak of the RC4 source code. A copy was sent to a well known member of sci.crypt, saying along the lines of "I think you can post this anonymously", if you agree to this please post a "Looking for Joe Random" post on sci.crypt. The source code was posted and there was no lawsuit, no tax audit, and no hassling by the government.

ahazred8ta6 months ago

This quickly led to a cottage industry of instructions on how to write your own RC4 CipherSaber util - https://github.com/search?q=ciphersaber&type=repositories -- http://ciphersaber.gurus.org/faq.html

astrashe26 months ago

I was on the Cypherpunks list, mostly as a lurker. The technical discussions were amazing. I was really into it at the time, but now I find some of the political ideas to be embarrassing.

Other people had a lot to do with the spread of strong crypto as well. Many people realized that encryption was necessary if we wanted to do business online. Matt Blaze (who was on the Cypherpunks list, but never said anything crazy), helped blow up the government's compromise solution, mandatory key escrow, by demonstrating flaws in their Clipper chip technology. The MIT Press published PGP's source code in book form, using an OCR font, because books couldn't be blocked as munitions. I think Hal Abelson, who wasn't on the list, was the person behind that.

The basic political idea behind the list was that you could effect change by writing code. Instead of going to the government, with your cap in your hand, and saying, Please, sir, can we have strong encryption?, you write code and give it away, thus making the law impossible to enforce. This sounds really cool when you're young, especially if you write code, but it's an anti-democratic idea.

The political positions of some of the leaders was kind of an extreme, anarchist spin on libertarianism. Bitcoin is a currency designed to solve a specific problem -- it's kind of the ultimate solution to the old goldbug fear that governments will print money and dilute the currency. That's impossible under Bitcoin.

The original crypto currency the Cypherpunks were really into was David Chaum's Digicash, which was designed to solve a completely different problem, the same one Monero is aimed at today. It was supposed to be untraceable. Instead of asking governments to lower taxes, the idea was that programmers could create a way to transfer funds anonymously. In theory, taxes would become impossible to collect, and national borders would collapse.

Eventually this led to things like discussions of anonymous murder contracts. There was a proposed protocol that was supposed to allow you to put out a hit on someone with complete safety. You could pay the killer anonymously with digital currency. I think the payment would go into some sort of escrow, so the killer would know they'd get paid. I don't remember how the system was able to know that the hit had taken place.

Those murder contracts were one of the things that made me pull back from the list. But it really was terrific to read, even though I think it would be a mistake to lionize it too much. Arguably, they were struggling to make the whole world run on 8chan's rules.

Hendrikto6 months ago

> This sounds really cool when you're young, especially if you write code, but it's an anti-democratic idea.

Is it? Code was deemed free speech, after all. So suppressing it would be anti-democratic, not spreading it.

pocketarc6 months ago

I -think- the anti-democratic thing is making it impossible to enforce the laws of a democratic society. If a democracy decides that strong encryption should be banned, going against that is going against the will of the people.

Of course, we all (technical people) agree that it was the right thing, but ask yourself: If there was a vote on the issue, do you think the majority of people would vote for keeping strong encryption, or do you think they'd ban it? Especially back then.

I personally think they'd ban it. I bet the majority would just go "encryption is for terrorists and bad people, we don't need it", and we'd lose the vote.

Democracy is funny that way.

+2
zarathustreal6 months ago
+1
justsomehnguy6 months ago
DonHopkins6 months ago

[flagged]

emmelaich6 months ago

Do you have examples of Gilmore's writing that you object to?

+1
DonHopkins5 months ago
IAmNotACellist6 months ago

Conspiracy-minded theory: only once the government successfully arranged for a process (behind closed doors) to subvert or capture any US-based cryptography efforts or communications.

dang6 months ago

Related:

How SSH got port number 22 - https://news.ycombinator.com/item?id=33363795 - Oct 2022 (2 comments)

How SSH Port Became 22 - https://news.ycombinator.com/item?id=21350246 - Oct 2019 (81 comments)

How SSH port became 22 - https://news.ycombinator.com/item?id=17552100 - July 2018 (95 comments)

How SSH got port number 22 - https://news.ycombinator.com/item?id=14178091 - April 2017 (207 comments)

ChrisArchitect5 months ago

(2017)

Was this article updated recently in some way? Not sure why it's mentioned at top of page, maybe just appended for posterity.

HN discussion then: https://news.ycombinator.com/item?id=14178091

dang5 months ago

Ah thanks! I've updated the list above.

mjlee6 months ago

Why 22 was available is also interesting. Network Control Protocol was the precursor to TCP and used different ports for inbound and outbound traffic, typically even for outbound and odd for inbound.

If you look in /etc/services you'll notice that all the older protocols listen on odd numbered ports.

Some of this still survives today. In active mode FTP servers listen on 21, ACK the inbound request and then connect to the client from 20.

macintux6 months ago

I do not miss the days of trying to figure out which FTP mode would work through a given firewall configuration.

donalhunt6 months ago

Had a very similar experience when I requested a Private Enterprise Number (PEN) in the early 00s.

I was doing some experimentation with LDAP, mailman and identity based encryption and needed some OIDs to support my undergraduate project work.

Private Enterprise Numbers are identifiers that can be used in SNMP configurations, in LDAP configurations, and wherever the use of an ASN.1 object identifier (OID) is appropriate.

So I went about signing up my university for a PEN. It helped that I also worked for the IT Services team at the time but I distinctly remember the request being done by email with the response more of less being "here's your number". :)

To my knowledge, I believe I'm the only person who has made use of the PEN assigned to the university.

hk__26 months ago

    From: Tatu Ylonen <ylo@cs.hut.fi>
    To: Internet Assigned Numbers Authority <iana@isi.edu>
    Subject: request for port number
    Organization: Helsinki University of Technology, Finland
Was "Organization" a common email header at the time? This is the first time I see it.
teddyh6 months ago

Many e-mail client still has a field for it in its account settings.

dannyobrien6 months ago

Yes!

bazil3766 months ago

“Can I have port 22?”

“Yes”

the early days of the internet are so fantastical to me I can’t stand it. Makes me sad to be too young to have witnessed it.

DonHopkins6 months ago

Wow that's a lot less negotiation than is required to tell a TCP joke! ;)

  Hello, would you like to hear a TCP joke?

  Yes, I'd like to hear a TCP joke.

  OK, I'll tell you a TCP joke.

  OK, I'll hear a TCP joke.

  Are you ready to hear a TCP joke?

  Yes, I am ready to hear a TCP joke.

  OK, I'm about to send the TCP joke. 
  It will last 10 seconds, 
  it has two characters, 
  it does not have a setting, 
  and it ends with punchline.

  OK, I'm ready to hear the TCP joke 
  that will last 10 seconds, 
  has two characters, 
  does not have a setting, 
  and will end with a punchline.

  I'm sorry, your connection has timed out...

  ...Hello, would you like to hear a TCP joke?
mxuribe6 months ago

OMG, this is brilliant! How have i never heard this one before!?! Thanks for sharing! :-D

DonHopkins6 months ago

I'd tell you a UDP joke, but you might not get it. ;)

mxuribe6 months ago

OMG another good one! :-D

EnigmaFlare6 months ago

Even if you were old enough, you probably wouldn't have witnessed it because it was only being worked on by a small number of people. There must be amazing future things which are in their early days right now but you and me aren't involved with them and nobody knows for sure what they even are until they explode.

I'm old enough to remember the early days of Bitcoin and how nobody I talked to about it had ever heard of it and was either dismissive ("That would be easy to hack" / "that can't work") or just treated it like a random chit-chat that didn't matter.

djao6 months ago

There was also that time Jon Postel asked all the DNS root server operators to make his server the root, and they did. https://www.wired.com/2012/10/joe-postel/

tptacek6 months ago

You don't really need permission to take a port; you can run your service on 80/tcp if you like.

jraph6 months ago

Here it's different than this, the question is rather "Can it be recorded that port 22 is reserved for my tool so it becomes a worldwide convention?"

otabdeveloper46 months ago

There is no worldwide convention. Go ahead and run your services on whatever ports. That's what I do.

+1
rob6 months ago
DonHopkins6 months ago

Yes there most certainly is a worldwide convention. Please read the article before commenting. Just because you don't happen to follow the convention does not mean it doesn't exist and isn't worldwide.

ninkendo6 months ago

> There is no worldwide convention.

Yeah, if only there were an authority that we could agree on to assign numbers for internet things like ports.

Some sort of internet assigned number authority

https://www.iana.org/assignments/service-names-port-numbers/...

autoexec6 months ago

You can, but you'll have to deal with the consequences of violating conventions and the impact of that might matter very little or a whole lot depending on the situation. Running a random service over port 80 can be a good idea (lots of networks have that port open), but you'd better be willing to deal with the traffic from people/bots/crawlers looking for a webserver there. If you aren't careful you can break things on your own network or get yourself cut off from others. The rules and standards that exist are there to make everyone's lives easier and promote things working. Deviate from them at your own risk.

grepfru_it6 months ago

Ah yes back when NANOG was an irc channel and anyone could join and discuss their routing problems.

It was a simpler time for sure

DonHopkins6 months ago

[flagged]

opoino6 months ago

What is all this idiot bullshit?

teddyh6 months ago

That is Don Hopkins, “a very imaginative fellow” (according to Richard Stallman), hacker extraordinaire, and very active in (and leader of many) important and well-known software projects throughout the 1990’s, or thereabouts. Here on HN, he often comments with insightful historical context (in his inimitable style). Just don’t get on his bad side, is all I’m saying (at this time); I have personal experience, but you can simply peruse his comment history here.

justsomehnguy6 months ago

You can understand if you read, especially https://news.ycombinator.com/item?id=14178993 and http://www.saildart.org/FTP.NCP[S,NET]

Hint: duplex and simplex.

macintux6 months ago

I don't think the concern was the technical content, which was enlightening.

DonHopkins6 months ago

[flagged]

Dwedit6 months ago

The early days of the internet were dominated by InfoSeek Net Search, then later on Alta Vista was the search engine of choice. Then later on, Google appeared and everyone else couldn't compete.

lttlrck6 months ago

That's closer to an abridged history of "World Wide Web" search engines.

The internet was decades old when Infoseek appeared.

jedrek6 months ago

the internet was decades old when http appeared.

jjav6 months ago

> The early days of the internet were dominated by InfoSeek Net Search

That's 20-some years after the early days of the Internet.

demondemidi6 months ago

I was using Archie and gopher in the late 80s. Do you mean web search instead of internet search?

defrost6 months ago

I'd been using the internet for 14 years before InfoSeek Net Search appeared in 1994, this is honestly the first time I've heard of it.

I don't even consider myself an early user of the internet either, the people I learnt from had already been using it a good while.

blahyawnblah6 months ago

Was it DEC than ran Alta Vista? They were involved in some search engine

coobird6 months ago

Indeed.[1]

I recall using it as my main search engine at altavista.digital.com before they moved to get its own domain at altavista.com.

[1] https://en.wikipedia.org/wiki/AltaVista

macintux6 months ago

I remember when AltaVista was the best, and despairing because it was so terrible.

At a dinner party, we were arguing about how to move forward with discovery on the web, because the situation was so dire. Someone was arguing for keyword registration, a la AOL.

I really, really hope that someone wasn’t me; I’ve convinced myself over the years it wasn’t, but I didn’t have any better ideas, just knew that wouldn’t work.

danielvaughn6 months ago

I’ve always wanted to see something like a common port dictionary or encyclopedia. Just a big list of all the ports, each with their common usage and the history behind it.

presentmonkey6 months ago

There's this wiki page that's pretty cool https://en.m.wikipedia.org/wiki/List_of_TCP_and_UDP_port_num...

skissane6 months ago

Wikipedia's list is better than the official one because it explains what some of those protocols actually are – especially the early ones which don't have any RFC specified in IANA's registry.

Although, in several cases, there is an RFC, even though IANA's registry doesn't record it. For example, port 1 (tcpmux / TCP Port Service Multiplexer) uses a protocol defined by RFC1078, as Wikipedia's article on it helpfully explains – https://en.wikipedia.org/wiki/TCP_Port_Service_Multiplexer – but IANA's registry doesn't mention that.

Or similarly, port 5 is listed as rje / Remote Job Entry in the registry, but Wikipedia helpfully notes that it is the protocol defined by RFC407 (and maybe RFC725 is a newer version of it?). I doubt that ARPANET RJE protocol (whose syntax resembles FTP, SMTP, etc) ever saw any great amount of implementation; I believe historically the most popular RJE protocols were IBM's (2780/3780 and later Network Job Entry / NJE which was used in RSCS, most notably on BITNET) – but those protocols don't have an assigned port number, since they don't natively run on top of TCP/IP.

There are however some historical mysteries in this IANA registry for which even Wikipedia does not know the answer: the first of many is what ports 2 and 3, "compressnet", were used for. (Edit: What Wikipedia doesn't know, HN does: https://news.ycombinator.com/item?id=37016159

hiAndrewQuinn6 months ago

Seconded. I made some Anki cards out of the table of the "Well-known ports" table and it has proven surprisingly helpful fingertip knowledge for my kind of work (Linux systems and small scale networks in odd places).

extraduder_ire6 months ago

Notably: port 666 - "Doom, the first online first-person shooter"

I'd like to see that email to IANA.

ttyprintk6 months ago

Nmap ships with an nmap-services file, which is a lot like /etc/services. However, you might find it interesting because it lists common worm backdoor ports rather than some obscure license server.

dabber6 months ago

You can start with the IANA list [0]. You won't find posts like this listed but it should be a good place to start regardless.

[0]: https://www.iana.org/assignments/service-names-port-numbers/...

adamzegelin6 months ago

On Linux, /etc/services often contains a list of at least protocol names and numbers.

Nition6 months ago

One fun list is in the default NetComm router software which still has a huge list of pre-saved port forwarding info for multiplayer PC Games that hasn't been updated since around 2001. That's quite a fun nostalgic list to browse.[1]

[1] Here's A-D: https://i.imgur.com/tCn2FBB.png

XorNot6 months ago

I mean if we wait long enough everything will be on port 443...

skissane6 months ago

Questions from the distant future: "Why is there this hardcoded 16-bit field in the UDP header which is always 443? Why do we have an IPv6 header which is always followed by a UDP header which is always followed by a QUIC header? Why not just merge the three headers into one?"

And then RFC99999 defines a "new protocol" in which there is just a single header, which happens to have the same byte layout as IPv6+UDP+QUIC, with a bunch of fields like "reserved_01BB" which "always contains the bytes 0x01BB due to historical backward compatibility reasons"

bpye6 months ago

> Why do we have an IPv6 header

Ah you’re an optimist I see

pantulis6 months ago

> We have assigned port number 22 to ssh, with you as the point of contact. Joyce

Those were the early days when you could be designated as the point of a contact for a TCP port connection number and expect not to be swamped by emails!

notbeuller6 months ago

I used to have a registered port (in the 3000s) - didn’t get a lot of spam, but once I got a very angry phone call (!!!) from someone that tracked me down because their firewall blocked an incoming request in that port. They did their own research and decided it was my fault.

aussieguy12346 months ago

I always figured FTP is port 21, SFTP/SSH is port 22

IronWolve6 months ago

They seem to always leave off port 20 is also ftp.

grepfru_it6 months ago

It’s just a data channel. This changed with nat and the introduction of the PASV command which allowed the client to set a non-well known port for the data channel

oarsinsync6 months ago

> the introduction of the PASV command which allowed the client to set a non-well known port for the data channel

PASV instructs the server to specify another ip:port that it’s listening on to enable the client to connect.

PORT expects there to be an open port on the client for the server to connect to.

broodbucket6 months ago

That's exactly what TFA says?

justahuman746 months ago

this WKS field in DNS that it refers to isn't something I've heard about

Why isn't it used?

duskwuff6 months ago

The WKS record type was, at one point, a record listing all network services available on a host. It consisted of a bitmap where each bit represented a port number, counting from 0 (!), where a bit being set indicated that the host offered a service on that port. This scheme only worked for low port numbers; it also inappropriately conflated DNS names with hosts. (The latter was perhaps a reasonable assumption when WKS was created sometime in the '70s or '80s, but it certainly isn't anymore.)

The most definitive references to WKS are probably:

* RFC 1035 (1987), which defines the record format.

* RFC 1912 (1996), which noted that "[WKS records] serve no known useful function, except internally among LISP machines. Don't use them."

justsomehnguy6 months ago

You can do a lot better now with SRV records.

usr11066 months ago

In 1995 everybody sending email was trustworthy. Those were the days...

Edit: Except if their address was @aol.com. Eternal September started in 1993.

I_am_uncreative6 months ago

I have a shirt that says "The Internet is full: Go Away!"

tetris116 months ago

I will pay you 5 cents to print 15 of those t-shirts, with my company logo on it and a QR code that points to an article about an internet standard and why my crypto startup is better than it. 10 cents, final offer.

j16sdiz6 months ago

I wonder if IANA still assign numbers? Can I have them assign ports for, say, redis?

teddyh6 months ago

You shouldn’t need a hardcoded port number for a newly designed protocol. Register a service name instead, and use SRV or SVCB records in the DNS (and/or ZeroConf).

You’ll notice that on the official IANA list of port numbers and service names, there is a separate section, after the numbered ports, listing only service names¹. Just apply for one of those.

1. At the time of writing, starting on page 135 of the HTML version: <https://www.iana.org/assignments/service-names-port-numbers/...>

sgjohnson6 months ago

Yes, they do. Their mission hasn’t changed since IANAs inception.

But getting a port assignment these days is going to be virtually impossible. It’s probably not going to happen without at least a Proposed Standard RFC.

https://www.iana.org/assignments/service-names-port-numbers/...

There’s not a single RFC published that concerns redis. It’s not going to happen.

ivlad6 months ago

I got a port assigned a few years ago.

I needed to write a justification why the organisation I represented needs a port number (a custom binary protocol), a formal confirmation that protocol has versioning built-in (so we will not request for a new port number for the next version of the protocol), a confirmation that we have a running code implementing the protocol (if I recall correctly, link to documentation was sufficient), and the reasons why we cannot use any of the existing protocols.

It’s not impossible and I think it’s totally doable for redis unless the port is already reserved for something else.

dmurray6 months ago

Probably for the best.

If there was a moderately complicated bureaucratic process to be assured of getting one, it wouldn't be Redis or the next SSH that got assigned ports. It would be Oracle or HP or someone else incapable of pretending to be a good Internet citizen, who filled in 10,000 of the forms promising that they have 10,000 totally necessary well known enterprise services.

chupasaurus6 months ago

Someone should steal 666 TCP/UDP, no RFC and contact email is of a person who leaved id in 1996.

elzbardico6 months ago

They could if redis went the way of proposing a RFC for their protocol. But I don't think it would be a good idea. But, if instead someone came up with a RFC proposing a standard protocol for communications with generic key-value stores like redis, it would make a lot more sense.

FredPret6 months ago

SSH is the most fantastic piece of black magic. So many incredible things are easy and secure.

Port forwarding

Reverse port forwarding

Rsync

So much more. And it's free. What a privilege to be alive today - I remember when all this was just a dream.

SeanLuke6 months ago

The headline of the article does not match the posting, which breaks a rule I believe. Could we at least correct the posting's grammar? To "How SSH became Port 22".

a-dub6 months ago

reminds me of the days when s/keys over telnet were cool.

there should be a vh1 where are they now special for assigned ports in /etc/services that shipped with early slackware.

kshay6 months ago

I like how he didn’t explicitly request 22. It was more like “anything 1-255 would be great... oh, by the way, I happen to be using 22...”

hk__26 months ago

He did request it:

> It would be great if this number could be used

emmelaich6 months ago

ssh also used to use source port 22. At least a popular implementation of it did. A bit of websearching didn't find it; anyone else remember this?

zamadatix5 months ago

Wouldn't that have meant you couldn't ssh out of a machine running an ssh server since the port was already bound to another process?

imaginator6 months ago

This is a good example of make it easy for others to say yes.

Jakesbeb6 months ago

[flagged]