curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: What Am I Doing Wrong With cURL and SFTP?

From: Michael Newman via curl-users <curl-users_at_cool.haxx.se>
Date: Tue, 25 Aug 2020 17:25:47 +0700

I have one more question about this.

> On Aug 24, 2020, at 14:52, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> The SFTP URL here implies the root directory. If you want to put the file in your home directory you need to specify that. Possibly by using the URL "sftp://ftp.myhost.com/~/".

If I use sftp all by itself, it seems to default to my home directory:

pi_at_raspsky:~/webcam $ sftp mgnewman_at_ftp.myhost.com
Connected to mgnewman_at_ftp.myhost.com.
sftp> pwd
Remote working directory: /home3/mgnewman

But, if I use curl with sftp, I have to tell it to go to my home directory:

curl -u mgnewman: --pubkey ~/.ssh/id_rsa.pub sftp://ftp.myhost.com/~/

Why the difference?

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-08-25