Curl : How to pass password containing a percent sign

13,980

Solution 1

I have just replayed your case: made user test / some%password and secured my site.

These two commands works: curl -u 'test:some%password' curl -u test:some%password

It seems you just using wrong password or misspelled server name

Solution 2

Have you tried it using ASCII code?

curl -u Login:Pass%25Word

Source

Share:
13,980

Related videos on Youtube

Malachi
Author by

Malachi

Updated on June 29, 2022

Comments

  • Malachi
    Malachi almost 2 years

    I'm not using PHP, but another language for this.. just FYI. However, I included the PHP as a tag, just in case someone there has a solution...

    At the moment I'm first trying to get the string right (to download a file through curl from a remote server to a local domain). Anyway, the password contains a percent sign (%). When I do this, I get the following error on my command line:

    curl: (67) Access denied: 530
    

    The 67 is an error code from curl (see also http://curl.haxx.se/docs/manpage.html) and means that "The user name, password, or similar was not accepted and curl failed to log in."

    Now say the original string would be this:

    curl -u Login:Pass%Word
    

    I've tried the following solutions that I found on the net:

    curl -u Login:Pass%25Word
    curl -u Login:Pass%%Word
    curl -u Login:Pass^%Word
    curl -u Login:Pass^%%Word
    

    However.. I ALWAYS get the Access denied.

    Could someone help me out, please?

    • GolezTrol
      GolezTrol
      Can you try if it works if you change the password? Or if you try a user that has a password without such characters?
  • Malachi
    Malachi over 11 years
    (and I got the other things I tried also from that website... )
  • Malachi
    Malachi over 11 years
    Yes, you're right. I checked the login name that I had in an email, verified it with what I've been using (but never looked at in an ftp connection), and the login name in the email had a capital letter halfway the login. In the ftp (and then I remembered calling about this a few months ago) it did NOT have that capital letter halfway. Fixing this made it all work perfectly. Thanks!