curl shows a greater-than sign instead of uploading a given file to a given server

1

I want to upload a file to a WebDAV server within Linux command line. The standard recommendation for this is to use curl in the following way:

curl -u mail_address:password -T filename.ext https://my_server.com/dav/filename.ext

When I execute this command, it shows me a greater-than sign in the command prompt, as if my command was incomplete, no uploading happens:

$ curl -u mail_address:password -T filename.ext https://my_server.com/dav/filename.ext
$ >

However, it doesn't tell me what I have to type here, and no positing on the internet (e.g. Is there a way of uploading to box.com storage via the command line?) ever mentioned that you have to type some additional stuff after this command. Any ideas how to fix this? mail_address and password refer to an existing account, and filename.ext refers to an existing file on my machine.

P.S.

  • Ubuntu 14.04
  • curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3

manuel

Posted 2016-07-26T11:51:49.340

Reputation: 1 958

Answers

1

I bet your password has a quotation mark (' or ") in it. Bash thinks that you've begun a multiline string/quote, so it gives you your $PS2 prompt on the second line, which is usually >.

Make sure that your arguments are all properly escaped.

Example:
If your password is $jkl;'", then you can escape it with double quotes like "\$jkl;'\"".

Alternatively, you can run your command like this:

curl -u mail_address -T filename.ext https://dav.box.com/dav/filename.ext

Then, curl will prompt you for a password like so:

deltik@node51 [~]$ curl -u mail_address -T filename.ext https://dav.box.com/dav/filename.ext
Enter host password for user 'mail_address':

Documentation:

-u, --user <user:password>

Specify the user name and password to use for server authentication. Overrides -n, --netrc and --netrc-optional.

If you simply specify the user name, curl will prompt for a password.

The user name and passwords are split up on the first colon, which makes it impossible to use a colon in the user name with this option. The password can, still.

When using Kerberos V5 with a Windows based server you should include the Windows domain name in the user name, in order for the server to successfully obtain a Kerberos Ticket. If you don't then the initial authentication handshake may fail.

When using NTLM, the user name can be specified simply as the user name, without the domain, if there is a single domain and forest in your setup for example.

To specify the domain name use either Down-Level Logon Name or UPN (User Principal Name) formats. For example, EXAMPLE\user and user@example.com respectively.

If you use a Windows SSPI-enabled curl binary and perform Kerberos V5, Negotiate, NTLM or Digest authentication then you can tell curl to select the user name and password from your environment by specifying a single colon with this option: "-u :".

If this option is used several times, the last one will be used.

Deltik

Posted 2016-07-26T11:51:49.340

Reputation: 16 807

Indeed, there was a quotation mark in my password. Thanks. – manuel – 2016-07-26T13:01:23.807