SFTP
SFTP is a request-response protocol for transferring files and accessing remote filesystem objects, normally carried over an authenticated SSH connection.
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. [1] [2] [3]
OpenSSH 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. [4] [1]
OpenSSH 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. [5] [7]
The 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. [4] [6] [7]
Relations
- related
- Backup verification, Backup manifest, Restore test, fsync, Directory fsync, Rsync quick check
Advantages
- Provides file-data and filesystem-metadata operations through a common request-response protocol. [1]
Limitations
- Server-advertised extensions and client support vary; an SFTP label alone does not establish the required operation or its result. [4]
- Transfer completion does not by itself verify an existing prefix, application consistency or recoverability. [5, 7]
Citations
- SSH File Transfer Protocol, version 3: expired Internet-Draft, sections 1-4
- RFC 4217: Securing FTP with TLS
- OpenSSH 9.0 release notes: scp switches to SFTP by default
- OpenSSH 10.6p2 PROTOCOL: file-transfer version, extension advertisement and fsync
- OpenSSH 10.6p2 sftp(1): resume precondition and synchronization options
- Linux fsync(2): file and containing-directory synchronization
- Hesela: SFTP completion, identity and synchronization controls
Sources & caveats
- 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. [7]