Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Network Services»FTP»What is Active FTP and Passive FTP

    What is Active FTP and Passive FTP

    By RahulAugust 5, 20223 Mins Read

    FTP (File Transfer Protocol) is TCP based service. FTP is widely used for transferring files over a network. There are various FTP servers are available to use like vsftpd, proftpd, pureftpd etc.

    Advertisement

    FTP uses two different ports –

    1. Port 20 is used for the data port, But the data port is not always on the 20 port. It may change in passive mode.
    2. Port 21 is used as command port.

    FTP works in two different modes Active FTP and Passive FTP as per server and client configuration. In this article, I am trying to define Active FTP vs Passive FTP in a definitive explanation, I hope this will help you to understand its working.

    Active FTP

    In Active mode FTP, the client connects from any random unprivileged port ( For example ‘X’ ( greater than 1023 ) ) to FTP Server port 21. The client again sends the ‘X+1’ port to the FTP server which is acknowledged on the command channel. After that FTP server opens the data channel on port 20 to Clients port X+1.

    • FTP client opens up command channel from client on port 1050 (1050 is for example only) to server port 21.
    • FTP client sends PORT 1051 (1050 + 1) to FTP server and server acknowledges on command channel.
    • FTP Server opens up data channel from server port 20 to client port 1051.
    • FTP client acknowledges on data channel.

    Passive FTP

    In Passive mode FTP, the client connects from any random unprivileged port (For example ‘X’ (greater than 1023)) to FTP Server port 21. After that client sends a PASV signal to the FTP server command channel to inform the server for using passive mode. FTP server sends back on an unprivileged port (For example ‘Y’ (greater than 1023)). Now FTP client opens the data channel on ‘X+1’ to FTP server PORT ‘Y’. Which acknowledges by the FTP server.

    • FTP client opens up command channel from client on port 1050 (1050 is for example only) to server port 21.
    • FTP client sends PASV command to server on command channel.
    • FTP server sends back (on command channel) PORT 1250 (1250 for example only) after starting to listen on that port.
    • FTP client opens up data channel from client 1051 to server port 1250.
    • FTP server acknowledges on data channel.

    I hope the above details may help you understand the difference between Active FTP vs Passive FTP, We are waiting for your comments for whether this article is helpful or not helpful for you. Read our next article, how to download and upload files with ftp.

    active-ftp FTP ftp modes passive-ftp
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    10 Best Linux FTP Clients in 2022

    How to Setup VSFTP on Ubuntu

    How To Setup FTP Server with VSFTPD on Ubuntu 20.04

    Create SFTP Only User on Debian

    How to Create SFTP Only User in Ubuntu & Debian

    View 3 Comments

    3 Comments

    1. Amit kumar on August 3, 2017 1:08 pm

      Good post..giving clear views..

      Reply
    2. Web Meetings on December 11, 2016 5:01 pm

      Hey Rahul,

      Thank you for the explanation. I hadn’t understood what a passive FTP was before reading this post. Your writing is clear and easy to understand.

      Thanks,
      Dennis

      Reply
    3. Tim Liu on December 4, 2015 9:13 am

      After reading other articles, this one is the clearest to me. Now I understand completely. Thank you so much. Thumbs up.

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    • sleep Command in Linux with Examples
    • 20 Basic Linux Commands for the Beginners (Recommended)
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.