cURL / Mailing Lists / curl-users / Single Mail


RE: sftp Command Line help

From: Michael Lam <>
Date: Mon, 18 Apr 2011 12:55:37 -0400

I guess what I don't understand is why I have to specify the location of the public key locally and not on the server. I tried to specify the location on the server but always got the error "cannot open file"

Daniel Stenberg <> wrote:

On Mon, 18 Apr 2011, Michael Lam wrote:

> curl -v -u mlam: --key C:/cygwin/home/mlam/.ssh/id_rsa --pubkey
> c:/cygwin/home/mlam/.ssh/id -T c:\temp2\test4.txt
> sftp://servername/var/SFTP/test10.txt --insecure
> The --pubkey option puzzles me since I thought the SFTP server can
> automatically located the public key on the server based on the username, as
> the public key is located in the folder /home/mlam/.ssh.

I'm glad you made it work!

Figuring out the public key is not the job of the server, it is the job of the
client to pass that on to the server.

With curl we have to point that out like this due to deficiancies in the
underlying libssh2 library. It is possible to deduct the public one from the
private one, and libssh2 has gotten that ability recently but we haven't yet
made libcurl able to use that functionality - and perhaps you're not even
using such a new libssh2 that would be able to.

Patches are of course always welcome!

List admin:
List admin:
Received on 2011-04-18