blob: 930df83cc271621ebeddcd0be6b24e0fb13266e7 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
2SPDX-License-Identifier: curl
3Long: user
4Short: u
5Arg: <user:password>
6Help: Server user and password
7Category: important auth
8Example: -u user:secret $URL
9Added: 4.0
10See-also: netrc config
11Multi: single
12---
13Specify the user name and password to use for server authentication. Overrides
14--netrc and --netrc-optional.
15
16If you simply specify the user name, curl will prompt for a password.
17
18The user name and passwords are split up on the first colon, which makes it
19impossible to use a colon in the user name with this option. The password can,
20still.
21
22On systems where it works, curl will hide the given option argument from
23process listings. This is not enough to protect credentials from possibly
24getting seen by other users on the same system as they will still be visible
25for a moment before cleared. Such sensitive data should be retrieved from a
26file instead or similar and never used in clear text in a command line.
27
28When using Kerberos V5 with a Windows based server you should include the
29Windows domain name in the user name, in order for the server to successfully
30obtain a Kerberos Ticket. If you do not, then the initial authentication
31handshake may fail.
32
33When using NTLM, the user name can be specified simply as the user name,
34without the domain, if there is a single domain and forest in your setup
35for example.
36
37To specify the domain name use either Down-Level Logon Name or UPN (User
38Principal Name) formats. For example, EXAMPLE\\user and user@example.com
39respectively.
40
41If you use a Windows SSPI-enabled curl binary and perform Kerberos V5,
42Negotiate, NTLM or Digest authentication then you can tell curl to select
43the user name and password from your environment by specifying a single colon
44with this option: "-u :".