FTP and FTP Port, SFTP and SFTP Port: Quick Reference

-

|

Introduction

FTP and SFTP are two protocols for transferring files between a server and a client computer. FTP port is 21 while SFTP port is 22. SFTP communicates via encrypted connection, while FTP uses plain-text (unsecured) communication.

This quick reference guide covers FTP and SFTP, how they work and the differences between them.

What is FTP & FTP Port Number?

FTP (File Transfer Protocol) is a client-server communication protocol used to transfer files between a client and a server. FTP port is 21.

Advertisements


File Transfer Protocol (FTP) Clint-Server Model and Authentication

For FTP communication to occur there has to be a server and a client.

FTP requires that clients authenticate with the server when they attempt to connect. Authentication is via clear-text, meaning the communication between the FTP client and FTP server is not encrypted.

This makes FTP communication insecure. Meaning that an intruder with access to the communication will be able to see user names, password and files transferred.

FTP connection can be Active or Passive. This determines how a data connection is established between the client and the server. In both connection types, the client creates a TCP (Transmission Control Protocol) connection to the server via FTP port 21.

In active FTP mode, the connection begins by the client listening for incoming data connections from a random port, FTP port M. The client then sends FTP command PORT to let the server know which FTP port it is listening on. Next, in the communication process the server initiates a data channel to the client from its port 20, the FTP server data port.

There are circumstances where the client is behind a firewall. A client behind a firewall may not be able to accept incoming TCP connections. In this circumstance, FTP Passive mode is used for the connection.

In Passive FTP mode, the client uses the control connection to send a PASV FTP command to the server. The client then receives an IP address and server port number from the server. Finally, the client uses the information received from the server to open a data connection from an arbitrary client FTP port to the IP address and port received.

FTP Port Numbers Explained

As described above, FTP uses two TCP connections for communication, FTP port 20 and 21. FTP port 21 is used to send control information from the server to the client. Port 21 is not used to send data files. The second FTP port, 20 is used to send data files between the server and the client.

What is SFTP & SFTP Port Number?

SFTP (SSH (or Secure) File Transfer Protocol) allows for file and data transfer over a connection secured using the SSH (Secure Shell) protocol. Unlike FTP in SFTP, communication between a client and a server is encrypted over SFTP port is 22.

Secure FTP (SFTP) Clint-Server Model and Authentication

Like FTP, SFTP communication occur between a client and a server. SFTP server requires a web server with the correct port (SFTP port 22 or any other port you choose to use).

The port must be forwarded to the FTP server from the firewall. Once you correctly install an SFTP server, an SSH Host key is generated. Users can then be created and assigned the necessary permissions that will allow them connect to the SFTP server.

To connect to a SFTP server, you require an SFTP Client. An SFTP Client could be a GUI or command line tool. The SFTP client authenticates and transfers files over a secure and encrypted connection to the SFTP server via SFTP port 22 (or the port specified in the SFTP server).

Differences Between FTP and SFTP

Apart from the TCP ports that FTP and SFTP use for connection, there are other differences between the two protocols.

The table below highlights the differences between the two protocols.

S/NFeatureFTPSFTP
1PortFTP runs on Port 21 and 20 SFTP uses port 22
2Data TransmissionUses two separate channels to send control information and transfer data.SFTP combines control and data into secure packets and send them through a single channel.
3SecurityFTP communication is not encrypted. Meaning a third party could intercept the data.On the other hand, SFTP is data is sent via encrypted connections. If an intruder intercepts the data, it will be meaningless to the hacker.
4FirewallFTP is not firewall friendly. SFTP uses a single SFTP Port 22 for both inbound and outbound connections. This means that a single port can be opened in the firewall for SFTP communications.

Conclusion

In this quick reference guide, I covered FTP, SFTP, FTP port and SFTP port. FTP runs on port 20 and 21 while SFTP port is 22.

If you have any question or comment use the “Leave a reply” form at the end of this guide. You could also share your experience so other readers can benefit from it.

Other Helpful Guides

Additional Resources and References

  • Was this post Helpful?
  • YesNo

LEAVE A REPLY

Please enter your comment!
Please enter your name here

ADVERTISEMENTS

FEATURED POSTS

Best Christian Movies on Netflix

The 10 Best Christian Movies on Netflix

This Itechguide reviews the 10 best christian movies on Netflix. The movies are listed in reverse order – with the 10th movie...
How to Change Orientation in Google Docs

How to Change Orientation in Google Docs

This Itechguide teaches you how to change orientation in Google Docs. The guide covers steps to change orientation in Google Docs from...
How to Delete Google Photos

How to Delete Google Photos

This Itechguide teaches you how to delete Google Photos. The guide offers steps to delete Google Photos from the Google Photos App...
How to Install Windows 10 1909 Update Manually

How to Install Windows 10 1909 Update Manually

This Itechguide teaches you how to install Windows 10 1909 update manually. Windows 10 1909 (otherwise known as Windows 10 November update)...
How to Create a Poll on Facebook

How to Create a Poll on Facebook

This Itechguide teaches you how to create a poll on Facebook. You can create a poll on Facebook from a Facebook page...

AMAZON DEALS

TRENDING POSTS

Remote Desktop Connection

Remote Desktop Connection an Internal Error Has Occurred [Fixed]

Introduction I recently received the error message "Remote Desktop Connection an Internal Error Has Occurred". It was strange because...

Find My Samsung: Register and Use Samsung Find my Mobile

Introduction Ever wondered how you could find your Samsung phone if you lost it? Find my Samsung or Samsung...
What is the Difference Between PowerShell and CMD?

Windows Powershell vs CMD: Differences and Similarities

Introduction This short guide compares Windows PowerShell vs CMD (Windows command prompt). I will cover the history and nature...
Spotify No Longer Supports this Version of Microsoft Edge

Spotify No Longer Supports this Version of Microsoft Edge [Fixed]

Introduction When you open Spotify web player on Microsoft Edge, you may receive the error message "Spotify No Longer...
Windows 10 Won't Boot

Windows 10 Won’t Boot With Black Screen? 3 Ways to Fix It

Why Won't Windows 10 Boot Up? If your Windows 10 stops with a black screen, the first question in...

ADVERTISEMENTS

BEST OF ITECHGUIDES

Spotify No Longer Supports this Version of Microsoft Edge

Spotify No Longer Supports this Version of Microsoft Edge [Fixed]

Introduction When you open Spotify web player on Microsoft Edge, you may receive the error message "Spotify No Longer...
How to Unfollow Someone on Instagram

How to Unfollow Someone on Instagram

This Itechguide teaches you how to unfollow someone on Instagram. The guide offers steps to unfollow someone on Instagram from the Instagram...
How to get help in Windows 10

How to Get Help in Windows 10 in 5 Easy Ways

Introduction This "How to Get Help in Windows 10" guide discusses 5 easy ways you can find help while...
windows 10 lock screen timeout

How to Change Screen Time Out Setting in Windows 10

Introduction There are two easy ways to change Windows 10 lock screen timeout settings: Desktop...
How to Share a YouTube Playlist

How to Share a YouTube Playlist (From PC Browser or Mobile App)

This guide demonstrates how to share a YouTube playlist. The guide demos how to share a YouTube playlist:

RECENT POSTS

How to Bold Text on Facebook Post

How to Bold Text on Facebook Post

This Itechguide teaches you how to bold text on Facebook post. The guide covers steps to bold text on Facebook post from...
Best Crime Documentaries on Netflix

The 10 Best Crime Documentaries on Netflix

This Itechguide reviews the 10 best crime documentaries on Netflix. The documentaries are listed in reverse order – with the 10th documentary...
Best Netflix Series

The 10 Best Netflix Series

This Itechguide reviews the 10 best Netflix series. The series are listed in reverse order – with the 10th series on top....
How to Upload Video to Facebook

How to Upload Video to Facebook

This Itechguide teaches you how to upload video to Facebook. The guide covers steps to upload video to Facebook from a PC...
How to Delete a YouTube Video

How to Delete a YouTube Video

This Itechguide teaches you how to delete a YouTube video. The guide covers steps to delete a YouTube video from a PC...

AMAZON DEALS

MUST READ

Best Standup on Netflix

Top 10 Best Standup on Netflix

This Itechguide reviews the 10 best standup on Netflix. The standups are listed in reverse order – with the 10th standup on...
active directory interview questions

35 Active Directory Interview Questions and Answers

I have compiled 35 Active Directory interview questions and answers. Where necessary, I have also provided additional information to help you understand...

How to Share a Folder in Windows 10 (3 Methods)

Introduction This guide demos how to share folder in windows 10. It covers 3 methods. Options...
dhcp relay agent windows server 2016 not working

DHCP Relay Agent Windows Server 2016 Not Working [Fixed]

Introduction Most reports about DHCP relay agent not working in Windows Server 2016 has to do with clients in...
spotify no longer supports this version of chrome

How to Fix “Spotify no Longer Supports this Version of Chrome”

Introduction Have you been frustrated by "Spotify no Longer Supports this Version of Chrome" error? You are not alone!...

AMAZON DEALS

By using this website you agree to accept our Privacy Policy and Terms & Conditions