31

Why is 22 the default port number for SFTP? Is there any specific reason for this?

trilawney
  • 1,786
  • 6
  • 28
  • 36

5 Answers5

70

It's the default SSH port and SFTP is usually carried over an SSH tunnel.

longneck
  • 11,938
  • 2
  • 36
  • 44
marto
  • 4,402
  • 25
  • 15
17

Why is 21 the default port for FTP? Or 80 the default for HTTP? It is a convention.

CristiC
  • 22,068
  • 12
  • 57
  • 89
  • 3
    Thats why i am asking this. Is there any specific reason for this?. What will happen if i provide someother number. – trilawney Jun 07 '11 at 13:53
  • 2
    Nothing will happen if the port you served is not blocked or preserved. Those ports are called "Well known ports" so that you can write a program like FileZilla where the standard-port for connections is 21 or 22 but you can change it to any belief. – bastianwegge Jun 07 '11 at 13:54
  • 1
    If you change the port on the server, you need to explicitly tell your client to connect to that new port rather then the default one which you don't usually need to specify. Though this could decrease bot login attempts. – Davor Lucic Jun 07 '11 at 13:55
  • 1
    You can configure your server to listen to other port number instead of default one. But in this case, the client must also specify this during connection attempt. – CristiC Jun 07 '11 at 13:55
  • Because ftp is 21, and http://cdn3.sbnation.com/imported_assets/761831/spinal-tap-amp-11.jpg – ruffin Nov 04 '13 at 21:36
5

From Wikipedia:

Applications implementing common services often use specifically reserved, well-known port numbers for receiving service requests from client hosts. This process is known as listening and involves the receipt of a request on the well-known port and reestablishing one-to-one server-client communications on another private port, so that other clients may also contact the well-known service port. The well-known ports are defined by convention overseen by the Internet Assigned Numbers Authority (IANA).

Source

So as others mentioned, it's a convention.

Michael J.V.
  • 5,499
  • 1
  • 20
  • 16
2

Not authoritative, but interesting: 21 is FTP, 23 is telnet. 22 is SSH...something in between (that can take the place of both).

ftexperts
  • 690
  • 7
  • 8
0

Ahem, because 22 is the port number for ssh and has been for ages?

Frank Schmitt
  • 30,195
  • 12
  • 73
  • 107