您可以安全地從一個SSH服務器使用SFTP搶文件:
curl -u username sftp://server1.cyberciti.biz/path/to/file.txt
OR(注〜意味着您的$ HOME)
curl -u vivek sftp://home1.cyberciti.biz/~/docs/resume.pdf
您可以使用SCP從SSH服務器使用私鑰獲取文件進行身份驗證。
的語法是:
curl -u username: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub scp://home1.cyberciti.biz/~/Videos/rhn_register.ogv
凡
`-u username` - Specify the user name (and optional password) to use for server authentication.
`-u username:password` - Specify the user name (and optional password) to use for server authentication.
`--key ~/.ssh/id_rsa` - SSL or SSH private key file name. Allows you to provide your private key in this separate file.
`--pubkey ~/.ssh/id_rsa.pub` - SSH Public key file name. Allows you to provide your public key in this separate file.
scp://home1.cyberciti.biz/~/Videos/rhn_register.ogv - Use scp protocol and download file from my home server called home1.cyberciti.biz.
捲曲:(1)協議 「SFTP」 不支持或libcurl中禁用 – jliles