Guide

FTP return codes and SFTP status codes: the complete reference

Every FTP reply code (RFC 959) and SFTP status code (SSH_FX_*) explained, what each digit means, the most common errors like 550 and 530, and why FTP and SFTP codes are not the same thing.

If you run file transfers you’ll eventually stare at a numeric code and need to know what it means. There’s a trap worth clearing up first: FTP and SFTP use completely different code systems, because they’re completely different protocols. Mixing them up is the single most common source of confusion. This page covers both.

  • FTP / FTPS uses 3-digit reply codes defined in RFC 959 (e.g. 226, 530, 550).
  • SFTP is an SSH subsystem and uses status codes named SSH_FX_* (e.g. SSH_FX_PERMISSION_DENIED), not numeric FTP codes at all.

How FTP reply codes are structured

Every FTP reply is three digits, and each digit carries meaning.

First digit, did it work?

CodeMeaning
1xxPositive preliminary, command accepted, another reply is coming
2xxPositive completion, command succeeded
3xxPositive intermediate, accepted, but waiting for more input (e.g. password)
4xxTransient negative, failed, but try again (temporary)
5xxPermanent negative, failed, don’t retry as-is

Second digit, what area?

CodeArea
x0xSyntax
x1xInformation
x2xConnections
x3xAuthentication & accounting
x4xUnspecified
x5xFile system

So 550 reads as: permanent failure (5), file-system area (5), “your command was fine, but the file/path can’t be acted on.”

Common FTP reply codes

CodeMeaningWhat it usually means in practice
110Restart marker replyResuming a transfer
125Data connection already open; transfer starting
150File status OK; about to open data connectionNormal before a transfer
200Command OKGeneric success
211System status / help replyOften from FEAT
213File statusOften a file’s size or modify time
220Service ready for new userThe greeting when you connect
221Service closing control connectionNormal QUIT / logout
226Closing data connection; transfer successfulYour upload/download completed
227Entering Passive ModeServer gave you a passive data port
229Entering Extended Passive ModeThe IPv6-friendly EPSV form
230User logged in, proceedLogin succeeded
234Security mechanism acceptedFTPS AUTH TLS accepted (RFC 2228)
250Requested file action completede.g. a DELE or CWD worked
257”PATHNAME” createdReply to MKD/PWD
331User name OK, need passwordSend PASS next
332Need account for loginRarely used
350Requested action pending further informatione.g. REST before RETR
421Service not available, closing control connectionServer shutting down or too busy
425Can’t open data connectionUsually a passive/active mode or firewall problem
426Connection closed; transfer abortedThe data connection dropped mid-transfer
430Invalid username or passwordAuth failed
450File action not taken (file busy)Temporary, retry
451Action aborted: local errorServer-side error
452Insufficient storageOut of space (temporary)
500Syntax error, command unrecognizedThe server didn’t understand the command
501Syntax error in parametersBad arguments
502Command not implementedServer doesn’t support it
503Bad sequence of commandse.g. PASS before USER
504Command not implemented for that parameter
530Not logged inAuthentication required or failed, the classic login error
532Need account for storing files
534Request denied, policy requires SSLThe server wants FTPS, you tried plain FTP
550File unavailable (not found / no access)The most common error, wrong path or permissions
551Action aborted: page type unknownRare
552Exceeded storage allocationQuota hit
553File name not allowedThe name violates a server rule

The two you’ll see most

  • 530 Not logged in, credentials wrong, or you tried an operation before authenticating (or the server requires FTPS and you connected in plain FTP).
  • 550 File unavailable, the file or directory doesn’t exist, or your account lacks permission on it. The command was valid; the target is the problem.

SFTP status codes (these are NOT FTP codes)

SFTP runs over SSH and reports results with SSH_FXP_STATUS messages carrying an SSH_FX_* code. The core set (protocol version 3, the most widely implemented) is:

CodeNameMeaning
0SSH_FX_OKSuccess
1SSH_FX_EOFEnd of file (or no more directory entries)
2SSH_FX_NO_SUCH_FILEPath doesn’t exist
3SSH_FX_PERMISSION_DENIEDNot allowed
4SSH_FX_FAILUREGeneric failure (the catch-all)
5SSH_FX_BAD_MESSAGEMalformed packet
6SSH_FX_NO_CONNECTIONNo connection (client-side)
7SSH_FX_CONNECTION_LOSTConnection lost (client-side)
8SSH_FX_OP_UNSUPPORTEDThe server doesn’t support that operation

Later protocol versions (4–6) add more specific codes, invalid handle, no such path, file already exists, write-protect, quota exceeded, and so on, but many clients and servers negotiate version 3, so the eight above are what you’ll meet most.

Why your SFTP client shows a vaguer error than FTP would

Notice SFTP has a single generic SSH_FX_FAILURE (4) where FTP has many specific 5xx codes. That’s why an SFTP “permission denied” or “failure” can feel less precise than FTP’s 550 vs 530 vs 553. It’s a protocol difference, not your client misbehaving, and it’s why a good gateway’s audit log matters: when the protocol code is generic, the server-side log is where you find what actually happened.

FTP vs SFTP vs FTPS, in one line each

  • FTP, the original protocol (RFC 959). Numeric reply codes. Unencrypted.
  • FTPS, FTP wrapped in TLS (RFC 4217 / 2228). Same numeric reply codes, encrypted.
  • SFTP, a different protocol entirely, running over SSH. SSH_FX_* status codes, always encrypted.

If you’re choosing between them or just untangling which one you’re actually using, see the rest of our guides, including how to put SFTP in front of your own cloud storage.

Try it on your own bucket

Connect a bucket you already own, Amazon S3, Azure Blob, Google Cloud Storage, or an S3-compatible store, and hand out a clean SFTP endpoint in minutes. Your files stay in your cloud.

Start free

← All guides