FTP reply code 221 is sent by the server after the client issues a QUIT command, confirming the session is ending and the control connection will be closed. This is the normal, graceful end of an FTP session. After 221, the TCP connection on port 21 is terminated. If the server sends 221 without the client sending QUIT, it may be enforcing an idle timeout or shutting down. Any active data transfers should be completed before QUIT is issued — sending QUIT during an active transfer may result in incomplete files.
The client sent QUIT after completing all file transfers and the server acknowledged with 221. This is the expected end of every FTP session. The client should close its end of the TCP connection after receiving this response.
FTP servers enforce idle timeouts (typically 60-300 seconds). If the client does not send any commands within the timeout period, the server sends 221 and disconnects. This is normal behavior to free up server resources.
During a graceful server shutdown, the FTP daemon sends 221 to all connected clients before stopping. This allows clients to cleanly close their connections.
If the connection closed unexpectedly, check your FTP client logs to see if QUIT was sent. If not, the server may have timed out the connection due to inactivity.
If your FTP client is idle for long periods, send NOOP commands periodically to keep the connection alive. Most FTP clients have a keep-alive setting that does this automatically.
Ensure all data transfers are complete (you have received 226) before sending QUIT. Disconnecting during an active transfer may corrupt the file.
The FTP server is ready and accepting connections. This is the greeting banner sent upon connection.
The file transfer completed successfully and the data connection is being closed.
The FTP server is unavailable and is closing the connection. The client should retry later.