Understand and troubleshoot FTP reply codes. Browse preliminary replies, success responses, intermediate replies, transient failures, and permanent rejections with step-by-step fix guides.
Permanent failures indicate the command will not succeed and the client should not retry with the same parameters. These require correcting the command syntax, file permissions, credentials, or server configuration.
The server did not recognize the FTP command. It may be misspelled, malformed, or unsupported.
The FTP command was recognized but the parameters or arguments are invalid.
The FTP server recognized the command but has not implemented it or has disabled it.
The FTP commands were sent in the wrong order. The server requires a specific command sequence.
The command is recognized but a specific parameter value is not supported.
The user is not logged in. Authentication is required before this command can be executed.
The server requires an ACCT command before files can be stored or uploaded.
The file or directory operation failed. The path does not exist, or access is denied.
The server cannot process the request because the page structure type is unknown.
The file operation was rejected because it exceeds the storage limit or allocation.
The filename or path is not allowed by the server's naming rules or access policy.
Transient failures mean the server cannot process the request right now but the condition may change. The client should retry after a delay. These include connection issues, file locks, and storage limitations.
The FTP server is unavailable and is closing the connection. The client should retry later.
The server could not establish the data connection needed for the file transfer.
The data connection was closed unexpectedly and the file transfer was aborted.
The file operation was not completed because the file is temporarily unavailable.
The server encountered an internal error while processing the command. The client should retry later.
The server does not have enough disk space to complete the file operation.
Intermediate responses indicate the server needs more information before completing the action. These appear during authentication (needing a password) and multi-step operations (file rename, transfer resume).
The username was accepted. The server is now waiting for the password.
The server requires an account name (ACCT command) in addition to the username and password.
The server is waiting for additional information to complete the requested action.
Success responses confirm that the command was processed and completed. These include login confirmations, file operation completions, transfer completions, and mode changes.
The FTP command was understood and executed successfully.
The server is reporting its system status or listing supported features.
The server is reporting the status or size of the specified file.
The server is providing help text about available commands or usage instructions.
The server is reporting its operating system type in response to a SYST command.
The FTP server is ready and accepting connections. This is the greeting banner sent upon connection.
The server is closing the FTP control connection in response to a QUIT command.
The data connection is open but no file transfer is currently active.
The file transfer completed successfully and the data connection is being closed.
The server is entering passive mode and has provided the IP and port for the data connection.
The server is entering extended passive mode and has provided the port for the data connection.
Authentication successful. The user is now logged in and can access the server.
The server accepted the AUTH TLS command and the connection is being upgraded to TLS encryption.
The file or directory operation was completed successfully.
The directory was created or the current directory path is being returned.
Preliminary replies indicate that the command was accepted and the action is starting. The client should expect another reply before sending a new command. These typically appear at the beginning of file transfers.
The server is sending a restart marker to help resume an interrupted file transfer.
The FTP server is not ready yet but will be available shortly. The client should wait and retry.
The data connection is already established and the file transfer is beginning immediately.
The server is ready to transfer the file and is about to open the data connection.
FTP (File Transfer Protocol) uses two separate TCP connections: a control connection for commands and responses, and a data connection for file transfers and directory listings. Understanding this dual-connection architecture is key to diagnosing FTP errors.
The client opens a TCP connection to the FTP server on port 21. The server responds with a 220 greeting banner containing its hostname and software version.
The client sends USER with the username (server responds 331), then PASS with the password. A 230 response confirms successful login. For anonymous access, use USER anonymous.
The client queries server capabilities with FEAT, sets transfer type with TYPE I (binary) or TYPE A (ASCII), and identifies the OS with SYST. These configure the session for correct file handling.
Before any transfer, the client sets up the data channel. In passive mode (PASV/EPSV), the server opens a port and the client connects to it. In active mode (PORT), the client opens a port and the server connects back.
The client sends RETR (download) or STOR (upload) with the filename. The server responds 150 (opening data connection), transfers the data, then sends 226 (transfer complete) when finished.
The client sends QUIT, the server responds with 221, and the control connection is closed. Ensure all transfers are complete before disconnecting.
Each step returns a specific FTP reply code. When something fails, the code tells you exactly which step broke down and whether the failure is temporary (4xx) or permanent (5xx).
The most common source of FTP errors (especially 425 “Can't open data connection”) is the mismatch between active and passive mode and firewall rules. Understanding the difference is essential for FTP troubleshooting.
The client sends a PORT command with its IP and a port number. The server then initiates a connection from its port 20 to the client's specified port. This fails through firewalls and NAT because most networks block inbound connections to client machines. Active mode is legacy and should be avoided unless both sides are on the same LAN.
The client sends PASV (or EPSV for IPv6), and the server responds with an IP and port to connect to. The client then initiates a connection to the server's data port. This works through firewalls and NAT because the client only makes outbound connections. The server must have a range of passive ports open in its firewall.
If you see error 425, switch to passive mode. If PASV returns a private IP (the server is behind NAT), use EPSV instead — it only returns the port, and the client connects to the same IP used for the control connection.
Choosing the right file transfer protocol matters for security. Plain FTP is unencrypted — credentials and file data are sent in cleartext. Modern deployments should use FTPS or SFTP.
The original protocol (RFC 959). No encryption — passwords, commands, and file data are all in plaintext. Vulnerable to eavesdropping and credential theft. Should only be used on trusted networks or for public anonymous downloads.
FTP with TLS/SSL encryption. Explicit FTPS starts on port 21 and upgrades via AUTH TLS (code 234). Implicit FTPS connects to port 990 with TLS from the start. Uses the same FTP reply codes. Requires certificate management.
A completely different protocol running over SSH. Not related to FTP despite the name. Single connection (no separate data channel), built-in encryption, key-based auth. Does not use FTP reply codes. Generally the simplest and most secure option.
For new deployments, SFTP is recommended because it uses a single connection (no firewall/NAT issues), provides strong encryption, and supports key-based authentication. Use FTPS when you need compatibility with existing FTP workflows and infrastructure.