简短结论先说:SFTP 本身协议层面是支持“断点续传”能力的,但是否能真正“断点续传”取决于你用的客户端和命令。
下面详细说一下。
SFTP(SSH File Transfer Protocol)是基于 SSH 的,协议里支持:
write handle offset data)所以从协议角度,SFTP 是可以断点续传的。
lftplftp sftp://user@host
mirror -cget -c(续传下载)put -c(续传上传)示例:
get -c bigfile.iso
put -c bigfile.iso
✅ 最推荐用于断点续传
rsync over SSH(不是纯 SFTP,但常用)rsync -P -e ssh bigfile user@host:/path/
⚠️ 注意:这是 rsync over ssh,不是 sftp 命令
都支持 SFTP 断点续传(失败后可继续)
sftp 命令Linux 自带的:
sftp user@host
get / putscpscp file user@host:/path/
| 工具 | 是否支持 SFTP 断点续传 |
|---|---|
| sftp(系统命令) | ❌ |
| scp | ❌ |
| lftp | ✅ |
| rsync -e ssh | ✅ |
| FileZilla | ✅ |
| WinSCP | ✅ |
如果你想要稳定的 SFTP 断点续传:
✅ 用 lftp:
lftp sftp://user@host -e "put -c bigfile; bye"
或者 ✅ rsync:
rsync -P bigfile user@host:/path/
如果你愿意,可以告诉我:
我可以给你一条最合适的命令。