Skip to content
Storage Providers

SSH / SFTP

russh SFTP transport with .rship.part offset crash-resume, atomic posix-rename commits, and known_hosts verification.

The sftp backend (backend-sftp) is built on russh + russh-sftp. Every remote binary transfer uses staged temporary files with byte-offset resume and atomic posix-rename commit.

Setup Recipes#

rship auth sftp vps \
  --host 10.0.0.5 \
  --port 22 \
  --user deploy \
  --key-file ~/.ssh/id_ed25519 \
  --root-path /srv/backups

# Verify host key fingerprint & disk quota via statvfs
rship about vps:

Flags Reference (rship auth sftp)#

FlagDefaultDescription
<REMOTE>—Logical remote name (e.g. vps, nas-ssh)
--hostRequiredSSH server hostname or IP address
--port22TCP port
--userRequiredSSH username
--root-pathEmptyRemote working root (e.g. /data/backups or relative backups)
--key-fileNonePath to private key (ed25519, ecdsa, rsa)
--key-passphraseNonePassphrase for encrypted private key file
--passwordNonePassword authentication secret
--host-key-policyaccept-newaccept-new (TOFU), strict (require match in known_hosts), or insecure
--known-hostsDefault SSH fileCustom known_hosts path

Protocol Internals & Crash Resume#

  • Single-shot vs. resumable staging: Files <= 256 KiB write cleanly via direct staged transfer; larger uploads checkpoint every 16 MiB into .rship.part.* staging files with byte-offset crash-resume and promote atomically via SFTP posix-rename.
  • Bounded lazy session pooling: Opens SSH/SFTP channels lazily within rship's concurrency bounds and enforces independent connect_timeout (15s) and io_timeout (30s) limits.
  • Storage quota: Queries remote statvfs extension for rship about <remote>: without spawning an SSH shell.
  • No server-side copy: Like rclone's SFTP backend, sftp -> sftp transfers stream through the local BufferPool (<= 64 MiB RSS cap).
  • rclone migration: Imports host, port, user, obscured pass, key_file, and key_file_pass cleanly with rship config import-rclone.