{
  "slug": "sftp",
  "term": "SFTP",
  "aliases": [
    "SSH File Transfer Protocol"
  ],
  "definition": "SFTP is a request-response protocol for transferring files and accessing remote filesystem objects, normally carried over an authenticated SSH connection.",
  "note": "SFTP is distinct from FTPS, which protects FTP with TLS, and from the legacy SCP protocol. The OpenSSH scp command uses SFTP by default starting with release 9.0; a command name alone does not identify the wire protocol. [filexfer] [ftps] [scp9]\n\nOpenSSH implements file-transfer version 3 with named extensions. The server advertises extension names and versions; the client must support the required version. The underlying version-3 document is an expired Internet-Draft, not a published RFC. [protocol] [filexfer]\n\nOpenSSH resume assumes that the existing partial copy matches the source. Retaining a wrong prefix can preserve wrong bytes despite successful transfer completion. Verify the complete destination against a trusted source generation, not just its expected size. [manual] [evidence]\n\nThe fsync@openssh.com extension requests synchronization of an open file handle; it does not compare that file with a trusted source. On Linux, file fsync alone does not ensure persistence of its containing directory entry. Required extension support, synchronization results and restore acceptance need separate checks. [protocol] [fsync] [evidence]",
  "related": [
    "backup-verification",
    "backup-manifest",
    "restore-test",
    "fsync",
    "directory-fsync",
    "rsync-quick-check"
  ],
  "citations": [
    {
      "id": "filexfer",
      "title": "SSH File Transfer Protocol, version 3: expired Internet-Draft, sections 1-4",
      "url": "https://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt",
      "accessed": "2026-11-09"
    },
    {
      "id": "ftps",
      "title": "RFC 4217: Securing FTP with TLS",
      "url": "https://www.rfc-editor.org/rfc/rfc4217.html",
      "accessed": "2026-11-09"
    },
    {
      "id": "scp9",
      "title": "OpenSSH 9.0 release notes: scp switches to SFTP by default",
      "url": "https://www.openssh.org/txt/release-9.0",
      "accessed": "2026-11-09"
    },
    {
      "id": "protocol",
      "title": "OpenSSH 10.6p2 PROTOCOL: file-transfer version, extension advertisement and fsync",
      "url": "https://raw.githubusercontent.com/openssh/openssh-portable/d449e662b6b8b8cb20e852d8084c269af1c5e8f1/PROTOCOL",
      "accessed": "2026-11-09"
    },
    {
      "id": "manual",
      "title": "OpenSSH 10.6p2 sftp(1): resume precondition and synchronization options",
      "url": "https://raw.githubusercontent.com/openssh/openssh-portable/d449e662b6b8b8cb20e852d8084c269af1c5e8f1/sftp.1",
      "accessed": "2026-11-09"
    },
    {
      "id": "fsync",
      "title": "Linux fsync(2): file and containing-directory synchronization",
      "url": "https://man7.org/linux/man-pages/man2/fsync.2.html",
      "accessed": "2026-11-09"
    },
    {
      "id": "evidence",
      "title": "Hesela: SFTP completion, identity and synchronization controls",
      "url": "https://hesela.com/analyses/backup-verification-is-not-a-restore-test/#sftp-acceptance",
      "accessed": "2026-11-09"
    }
  ],
  "status": "shipping",
  "advantages": [
    {
      "text": "Provides file-data and filesystem-metadata operations through a common request-response protocol.",
      "citationIds": [
        "filexfer"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Server-advertised extensions and client support vary; an SFTP label alone does not establish the required operation or its result.",
      "citationIds": [
        "protocol"
      ]
    },
    {
      "text": "Transfer completion does not by itself verify an existing prefix, application consistency or recoverability.",
      "citationIds": [
        "manual",
        "evidence"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-09",
  "provenance": [
    "Protocol and implementation synthesis from primary documentation, not a new experiment. Linked Hesela observations use two selected OpenSSH builds and direct pipes without SSH transport; they do not establish behavior for every release or server. [evidence]"
  ]
}
