What Port Does SFTP Use?

Share:

SFTP is commonly used by businesses to securely transfer files so it is important to understand SFTP and that SFTP uses port 22.

Secure File Transfer Protocol

Although many think SFTP is an acronym for “Secure File Transfer Protocol”, it actually stands for SSH File Transfer Protocol. The encrypted protocol SSH (Secure Shell) is used to encrypt the connection before any files are transferred. This results in any and all files sent over SFTP being encrypted. There is no way to send files unencrypted over SFTP.

illustration showing sftp uses port 22 to encrypt connections

SFTP Uses Port 22

Since SFTP runs over the SSH protocol as a subsystem, SFTP uses port 22 by default. The SSH server at port 22 listens for client requests. The port number can be changed, if desired, for testing or other reasons.

The Internet Assigned Numbers Authority (IANA) assigned TCP port 22, UDP port 22 and SCTP port 22 for the SSH protocol. Described in the context of SSH-2, SFTP uses TCP.

How SFTP Server Authenticates with Client

Before an SFTP file transfer can occur, the client and server verify the connection via a three-way Transmission Control Protocol (TCP) handshake. The handshake occurs in a series of messages between the server and client to confirm both have access to the correct port (22) in the transport layer.

Next, the server authenticates the client using an SSH key pair. The key pair contains a public key, which both parties know, and a private key, which should only be known to the valid client.

Once SSH authentication is successfully completed, the file is transferred over the encrypted channel in packets. Each packet contains some of the data being transferred. At the receiving end, the packets are assembled into the original file.

For an intro to SFTP, please read SFTP Basics: How Secure File Transfer Protocol Works.

Want an In-Depth Understanding of SFTP?

If you want to learn more about SFTP, check out our comprehensive guide about SFTP, including

  • SFTP facts
  • How SFTP uses SSH and its keys
  • How SFTP fits into the TCP/IP model
  • The details of how SFTP works
  • FAQs about SFTP
 

Using SFTP with Managed File Transfer Software

As file transfer volumes increase, SFTP begins to fall short as a complete file transfer solution. Keeping up with demands to onboard more partners, scale infrastructure and troubleshoot issues can overwhelm your IT team. Furthermore, sensitive, business-critical file transactions require additional protection, control and visibility to meet security and governance requirements.

Managed file transfer (MFT) solutions provide this required functionality. Thru is a cloud-based service that utilizes multiple protocols, including SFTP, to provide comprehensive end-to-end security; granular tracking, logging and retention settings; and high availability. Visit our secure file transfer page to learn more about the added security and visibility of Thru’s MFT »
 
 

Share:

Have questions about managed file transfer?

Get answers, not a sales pitch. Our experts have analyzed, discussed and solved difficult file transfer challenges since 2002. We are here to help you.

Scroll to Top