2022-06-14 06:12:03 +08:00
|
|
|
c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
SPDX-License-Identifier: curl
|
2016-11-28 08:01:13 +08:00
|
|
|
Long: user
|
|
|
|
Short: u
|
|
|
|
Arg: <user:password>
|
|
|
|
Help: Server user and password
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: important auth
|
2021-08-31 22:37:14 +08:00
|
|
|
Example: -u user:secret $URL
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 4.0
|
2021-11-15 22:58:20 +08:00
|
|
|
See-also: netrc config
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: single
|
2016-11-28 08:01:13 +08:00
|
|
|
---
|
|
|
|
Specify the user name and password to use for server authentication. Overrides
|
|
|
|
--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.
|
|
|
|
|
2019-03-14 18:49:35 +08:00
|
|
|
On systems where it works, curl will hide the given option argument from
|
|
|
|
process listings. This is not enough to protect credentials from possibly
|
|
|
|
getting seen by other users on the same system as they will still be visible
|
2021-11-01 20:43:11 +08:00
|
|
|
for a moment before cleared. Such sensitive data should be retrieved from a
|
|
|
|
file instead or similar and never used in clear text in a command line.
|
2019-03-14 18:49:35 +08:00
|
|
|
|
2016-11-28 08:01:13 +08:00
|
|
|
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
|
2021-10-31 23:34:44 +08:00
|
|
|
obtain a Kerberos Ticket. If you do not, then the initial authentication
|
2016-11-28 08:01:13 +08:00
|
|
|
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 :".
|