-
In active mode, the client starts listening for incoming data connections from the server on port N. It sends the FTP command "PORT N" to inform the server on which port it is listening. The server then initiates a data channel to the client.
-
In situations where the client is behind a firewall and unable to accept incoming TCP connections, passive mode may be used. In this mode, the client uses the control connection to send the FTP command "PASV" to the server and then receives a server IP address and server port numbuer from server, which the client then uses to open a data connection.
- open hostname [ port ] - connect to ftp server
- user username - send new user information
- cd remote-directory - change working directory on the server
- cdup - change working directory on the server to parent directory
- ls [ remote-directory ] - list contents of remote directory
- pwd - print working directory on the server
- mkdir directory-name - make directory on the server
- rmdir directory-name - remove directory on the server
- put local-file [ remote-file ] - upload file to the server
- get remote-file [ local-file ] - download file from the server
- rename from-remote-path to-remote-path - rename file/directory on the server
- size remote-file - show size of remote file
- del remote-file - delete file on the server
- stat [ remote-file ] - show current status
- syst - show remote system type
- type - show current transfer type
- binary - set binary transfer type
- ascii - set ascii transfer type
- mode - show current mode for data connection
- active - set active mode for data connection
- passive - set passive mode for data connection
- noop - no operation
- rhelp [ remote-command ] - get help from the server
- close - close ftp connection
- help - print local help information
- exit - close ftp connection and exit
- Compiler support for C++17
- CMake 3.14 or newer
- Boost 1.67.0 or newer
- Python3 (only for tests)
mkdir build && cd build
cmake ..
cmake --build .
./bin/ftp- File Transfer Protocol – https://en.wikipedia.org/wiki/File_Transfer_Protocol
- RFC 959 File Transfer Protocol (FTP) Network Working Group J. Postel, J. Reynolds ISI October 1985