cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl: (67) Authentication failure for password containing # character

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 13 Oct 2010 00:39:01 +0200 (CEST)

On Tue, 12 Oct 2010, Sharma, Meghnath wrote:

> Curl Version used: curl 7.19.6
> Environment: AIX 5.3
> Command: curl -v -T test.txt -u gd94:gd#61ABC sftp://ftp.abc.com/test.txt

As this is SFTP, your libssh2 version is also a very important variable to
bring to the equation.

> I have written a Shell script that does the SFTP file transfer (using
> password) to a remote machine. When I use the CURL sftp command shown above
> I get 'Authentication Failure' issue. But when I run regular SFTP (no CURL)
> using same server/user/pwd information it works perfectly fine.

But did you provide the password to that "regular SFTP" on the command line
too? If not, I don't see how the test is comparable.

Did you try using curl without specifying the password on the command line and
instead enter it interactively to see what happens?

> I feel that CURL has an issue with '#' in the password.

I think not. I tried this command line just now:

$ curl -v -u moo#moo:he#llo localhost

And it shows clearly that 'moo#moo' is used as user name and in the HTTP
request we see "Authorization: Basic bW9vI21vbzpoZSNsbG8=" which when base64
decoded looks like: moo#moo:he#llo ...

So, if there truly is a problem with '#' in the password with curl, it is not
generic for all protocols.

Next step, try the user+password in the URL and do the #-letter URL-encoded,
like this:

  curl -v -T test.txt sftp://gd94:gd%2361ABC@ftp.abc.com/test.txt

> Is there any resolution w.r.t this issue? Or, do I have to use Regular SFTP
> instead?

I'm quite sure that neither curl nor libssh2 have any code that does anything
particular with #-letters in passwords.

And I trust you got it to work fine with curl if you don't have a '#' in the
password?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-13