cURL / Mailing Lists / curl-library / Single Mail


Re: Curl Library asking for key authentication when it shouldn't?

From: Brad Hards <>
Date: Fri, 18 Feb 2011 09:50:03 +1100

This is not really anything specific to curl. Its the ssh server on your

On Friday, February 18, 2011 09:34:20 am Saqib Ali wrote:
> Additionally, the directory /home/sali/.ssh/ only contains one file:
> known_hosts. Each line in this file contains what looks like an RSA key
> (the string directly after the IP address == "ssh-rsa")
Its the public key for the server, so you can recognise that the server isn't
being impersonated.

> So how can I tell libcurl to use RSA keys instead of DSA keys? And
> shouldn't the keys be irrelevant if I'm providing a username/password?
This is different to the authentication mechanism.

> > <>
> > * About to connect() to port 22 (#0)
> > * Trying * connected
> > * Connected to ( port 22 (#0)
> > * SSH authentication methods available:
> > gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
This line tells you that the ssh server accepts multiple authentication
methods (e.g. GSSAPI key exchange, Public Key, Password).

> > * Using ssh public key file /home/sali/.ssh/
> > * Using ssh private key file /home/sali/.ssh/id_dsa
> > * SSH public key authentication failed: Unable to open public key file
The server asked for public key before password, so curl tries that.

> > * Initialized password authentication
> > * Authentication complete
This looks like the password worked.

> > * Upload failed: Permission denied (3/-31)
> > * Connection #0 to host left intact
> > * Access denied to remote resource
At a guess, you are uploading to a file location you don't have permission to
write to (e.g. the root directory on the server).

You might understand this more if you try doing it with scp, and turning on
the verbose options. Reading the man page for scp and your ssh server might
also be useful.

List admin:
Received on 2011-02-17