How SSH got port number 22
A more interesting story is why are the older services using mainly odd port numbers (ie. 21 = FTP, 23 = telnet, why was port 22 free at that time?).  It turns out because the protocol which preceded the invention of TCP, called NCP, used even-odd pairs of port numbers, with even for &quot;outgoing&quot; data and odd for &quot;incoming&quot;.  So the well-known port numbers for incoming services were all odd.<p>Sources:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Network_Control_Program" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Network_Control_Program</a><p><a href="http:&#x2F;&#x2F;www.pcvr.nl&#x2F;tcpip&#x2F;introduc.htm" rel="nofollow">http:&#x2F;&#x2F;www.pcvr.nl&#x2F;tcpip&#x2F;introduc.htm</a>