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