xref: /aosp_15_r20/external/curl/docs/cmdline-opts/user.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerLong: user
5*6236dae4SAndroid Build Coastguard WorkerShort: u
6*6236dae4SAndroid Build Coastguard WorkerArg: <user:password>
7*6236dae4SAndroid Build Coastguard WorkerHelp: Server user and password
8*6236dae4SAndroid Build Coastguard WorkerCategory: important auth
9*6236dae4SAndroid Build Coastguard WorkerAdded: 4.0
10*6236dae4SAndroid Build Coastguard WorkerMulti: single
11*6236dae4SAndroid Build Coastguard WorkerSee-also:
12*6236dae4SAndroid Build Coastguard Worker  - netrc
13*6236dae4SAndroid Build Coastguard Worker  - config
14*6236dae4SAndroid Build Coastguard WorkerExample:
15*6236dae4SAndroid Build Coastguard Worker  - -u user:secret $URL
16*6236dae4SAndroid Build Coastguard Worker---
17*6236dae4SAndroid Build Coastguard Worker
18*6236dae4SAndroid Build Coastguard Worker# `--user`
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard WorkerSpecify the username and password to use for server authentication. Overrides
21*6236dae4SAndroid Build Coastguard Worker--netrc and --netrc-optional.
22*6236dae4SAndroid Build Coastguard Worker
23*6236dae4SAndroid Build Coastguard WorkerIf you simply specify the username, curl prompts for a password.
24*6236dae4SAndroid Build Coastguard Worker
25*6236dae4SAndroid Build Coastguard WorkerThe username and passwords are split up on the first colon, which makes it
26*6236dae4SAndroid Build Coastguard Workerimpossible to use a colon in the username with this option. The password can,
27*6236dae4SAndroid Build Coastguard Workerstill.
28*6236dae4SAndroid Build Coastguard Worker
29*6236dae4SAndroid Build Coastguard WorkerOn systems where it works, curl hides the given option argument from process
30*6236dae4SAndroid Build Coastguard Workerlistings. This is not enough to protect credentials from possibly getting seen
31*6236dae4SAndroid Build Coastguard Workerby other users on the same system as they still are visible for a moment
32*6236dae4SAndroid Build Coastguard Workerbefore cleared. Such sensitive data should be retrieved from a file instead or
33*6236dae4SAndroid Build Coastguard Workersimilar and never used in clear text in a command line.
34*6236dae4SAndroid Build Coastguard Worker
35*6236dae4SAndroid Build Coastguard WorkerWhen using Kerberos V5 with a Windows based server you should include the
36*6236dae4SAndroid Build Coastguard WorkerWindows domain name in the username, in order for the server to successfully
37*6236dae4SAndroid Build Coastguard Workerobtain a Kerberos Ticket. If you do not, then the initial authentication
38*6236dae4SAndroid Build Coastguard Workerhandshake may fail.
39*6236dae4SAndroid Build Coastguard Worker
40*6236dae4SAndroid Build Coastguard WorkerWhen using NTLM, the username can be specified simply as the username, without
41*6236dae4SAndroid Build Coastguard Workerthe domain, if there is a single domain and forest in your setup for example.
42*6236dae4SAndroid Build Coastguard Worker
43*6236dae4SAndroid Build Coastguard WorkerTo specify the domain name use either Down-Level Logon Name or UPN (User
44*6236dae4SAndroid Build Coastguard WorkerPrincipal Name) formats. For example, EXAMPLE\user and [email protected]
45*6236dae4SAndroid Build Coastguard Workerrespectively.
46*6236dae4SAndroid Build Coastguard Worker
47*6236dae4SAndroid Build Coastguard WorkerIf you use a Windows SSPI-enabled curl binary and perform Kerberos V5,
48*6236dae4SAndroid Build Coastguard WorkerNegotiate, NTLM or Digest authentication then you can tell curl to select the
49*6236dae4SAndroid Build Coastguard Workerusername and password from your environment by specifying a single colon with
50*6236dae4SAndroid Build Coastguard Workerthis option: "-u :".
51