What are Ports 20 and 21? (2024)

View all common networking ports

by Colin Cohen | Published on February 09, 2024

What are Ports 20 and 21? (1)

FTP servers use port 20 for file transmissions in FTP sessions. But they only do so in active mode FTP sessions. FTP servers use port 21 to receive commands from FTP clients. No transfer of files happens over this port.

Definition of Port 20

The Internet Assigned Numbers Authority (IANA) assigned port 20 to file transmissions during FTP sessions. You only use port 20 if you are using active FTP mode, which is problematic if the client has a firewall, as the server will need to open a random port on the client’s device.

Common Uses of Port 20

In active mode FTP sessions, you use port 20 to transmit files. Known as the data port, port 20 handles the uploading and downloading of files between a client and a server.

How Port 20 Operates in a Network Environment

In an active mode FTP session, the following occurs:

  • An FTP client logs into an FTP server over port 21 and establishes an active mode session using the PORT command.

  • The client issues commands to transfer files.

  • The server opens a data session from port 20 to a random port on the client.

  • If the server can communicate with the client over the client’s random port, the client and server transfer files between them over port 20.

Definition of Port 21

The IANA assigned port 21 to issue commands during an FTP session. Unlike port 20, you use port 21 during FTP sessions regardless of whether you use active or passive mode FTP.

Common Uses of Port 21

An FTP client connects to an FTP server over port 21, the command port, to issue FTP commands. These commands can include the following:

How Port 21 Operates in a Network Environment

Port 21 functions in the following manner:

  • An FTP client logs into an FTP server over port 21.

  • If the client sends a PORT command, the server attempts to establish an active mode FTP session by opening a random port on the FTP client’s device before transferring files over port 20.

  • If the client sends a PASV command, the client establishes a passive mode FTP session by opening a random port before transferring data between it and a random port on the server.

What are the Key Differences Between Port 20 and Port 21?

While port 20 and port 21 both relate to FTP use, there are key differences. Port 20 transfers files during active mode FTP sessions, while port 21 is for issuing commands related to FTP transfers.

Variances in Functionality

You use port 20 to transfer files in active mode FTP sessions. You use port 21 for issuing FTP commands in these sessions, whether the sessions are conducted in active mode or passive mode.

Security Implications of Each Port

The use of FTP over port 20 and 21 is inherently insecure because traffic passed over them is unencrypted. If security is a concern, you should consider using one of the secure versions of the protocol: Secure File Transfer Protocol (SFTP) over port 22 or File Transfer Protocol Secure (FTPS) over ports 989 and 990.

How to Identify and Differentiate Between the Two Ports

When you establish an FTP session by sending FTP commands between an FTP client and a FTP server, you do so over port 21. When you transmit files between the client and server, you do so over port 20, but only if you are engaging in an active mode FTP session.

What is the Importance of Port 20 and Port 21 to Data Transfer?

Both port 20 and port 21 are important when transferring files in FTP sessions. You use port 21 for sending commands relating to these transfers, and you use port 20 for the actual transfers in active mode FTP sessions.

Role of Port 20 and Port 21 in FTP (File Transfer Protocol)

In FTP, servers transfer files over port 20 during active FTP sessions. Clients issue FTP commands to servers over port 21 regardless of whether the FTP sessions are active or passive.

Impact on Uploading and Downloading Files

The uploading and downloading of files takes place over port 20 in active mode FTP sessions. Port 21 is for sending commands relating to the uploading and downloading of the files.

Potential Vulnerabilities Associated with These Ports

As there is no encryption when using FTP over port 20 and 21, anyone who can intercept the traffic can read the sessions. Additional vulnerabilities include brute force attacks and unauthorized directory traversals.

What are the Best Practices for Securing Port 20 and Port 21?

As no encryption takes place when using FTP over port 20 and 21, you should consider using one of the secure versions of FTP if security is a concern. Even if it’s not, you must set up firewall rules on your server.

Encryption Methods for Data Transfer

When using FTP over ports 20 and 21, no encryption takes place. If you want to use encryption with FTP, you need to do so with SFTP over port 22 or FTPS over ports 989 and 990.

Implementing Firewall Rules for Port 20 and Port 21

When using active mode FTP, you must open port 20 and 21 on your server through firewall rules. If you are using passive mode FTP, you only need to set up firewall rules for port 21 to open it for traffic.

Utilizing Secure FTP Protocols

You can set up a secure version of FTP through either SFTP (over port 22) or FTPS (over port 989 and 990.) Keep in mind that using FTPS is much faster than using SFTP.

What Happens When Port 20 and 21 Are Closed?

If either port 20 or port 21 are closed, you cannot establish an active mode FTP session. You only need to open port 21 for a passive mode FTP session.

Conclusion

Using FTP over port 20 and 21 lets you transfer files between FTP clients and servers. While port 21 is for sending commands to an FTP server, port 20 transfers files during active mode FTP sessions. As data sent over these ports are unencrypted, consider using one of the more secure versions of the protocol.

What are Ports 20 and 21? (2024)

References

Top Articles
Mother Of The Bride Dresses | High-end vs. Affordable - Cyndi Spivey
Wedding Cake Frosting And Cake Frosting Recipes
Spasa Parish
Rentals for rent in Maastricht
159R Bus Schedule Pdf
Sallisaw Bin Store
Black Adam Showtimes Near Maya Cinemas Delano
Espn Transfer Portal Basketball
Pollen Levels Richmond
11 Best Sites Like The Chive For Funny Pictures and Memes
Xenia Canary Dragon Age Origins
Momokun Leaked Controversy - Champion Magazine - Online Magazine
Maine Coon Craigslist
‘An affront to the memories of British sailors’: the lies that sank Hollywood’s sub thriller U-571
Tyreek Hill admits some regrets but calls for officer who restrained him to be fired | CNN
Haverhill, MA Obituaries | Driscoll Funeral Home and Cremation Service
Rogers Breece Obituaries
Ems Isd Skyward Family Access
Elektrische Arbeit W (Kilowattstunden kWh Strompreis Berechnen Berechnung)
Omni Id Portal Waconia
Kellifans.com
Banned in NYC: Airbnb One Year Later
Four-Legged Friday: Meet Tuscaloosa's Adoptable All-Stars Cub & Pickle
Model Center Jasmin
Ice Dodo Unblocked 76
Is Slatt Offensive
Labcorp Locations Near Me
Storm Prediction Center Convective Outlook
Experience the Convenience of Po Box 790010 St Louis Mo
Fungal Symbiote Terraria
modelo julia - PLAYBOARD
Poker News Views Gossip
Abby's Caribbean Cafe
Joanna Gaines Reveals Who Bought the 'Fixer Upper' Lake House and Her Favorite Features of the Milestone Project
Tri-State Dog Racing Results
Navy Qrs Supervisor Answers
Trade Chart Dave Richard
Lincoln Financial Field Section 110
Free Stuff Craigslist Roanoke Va
Stellaris Resolution
Wi Dept Of Regulation & Licensing
Pick N Pull Near Me [Locator Map + Guide + FAQ]
Crystal Westbrooks Nipple
Ice Hockey Dboard
Über 60 Prozent Rabatt auf E-Bikes: Aldi reduziert sämtliche Pedelecs stark im Preis - nur noch für kurze Zeit
Wie blocke ich einen Bot aus Boardman/USA - sellerforum.de
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Dermpathdiagnostics Com Pay Invoice
How To Use Price Chopper Points At Quiktrip
Maria Butina Bikini
Busted Newspaper Zapata Tx
Latest Posts
Article information

Author: Fredrick Kertzmann

Last Updated:

Views: 6691

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Fredrick Kertzmann

Birthday: 2000-04-29

Address: Apt. 203 613 Huels Gateway, Ralphtown, LA 40204

Phone: +2135150832870

Job: Regional Design Producer

Hobby: Nordic skating, Lacemaking, Mountain biking, Rowing, Gardening, Water sports, role-playing games

Introduction: My name is Fredrick Kertzmann, I am a gleaming, encouraging, inexpensive, thankful, tender, quaint, precious person who loves writing and wants to share my knowledge and understanding with you.