user.d 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. c: Copyright (C) 1998 - 2022, 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. ---
  12. Specify the user name and password to use for server authentication. Overrides
  13. --netrc and --netrc-optional.
  14. If you simply specify the user name, curl will prompt for a password.
  15. The user name and passwords are split up on the first colon, which makes it
  16. impossible to use a colon in the user name with this option. The password can,
  17. still.
  18. On systems where it works, curl will hide the given option argument from
  19. process listings. This is not enough to protect credentials from possibly
  20. getting seen by other users on the same system as they will still be visible
  21. for a moment before cleared. Such sensitive data should be retrieved from a
  22. file instead or similar and never used in clear text in a command line.
  23. When using Kerberos V5 with a Windows based server you should include the
  24. Windows domain name in the user name, in order for the server to successfully
  25. obtain a Kerberos Ticket. If you do not, then the initial authentication
  26. handshake may fail.
  27. When using NTLM, the user name can be specified simply as the user name,
  28. without the domain, if there is a single domain and forest in your setup
  29. for example.
  30. To specify the domain name use either Down-Level Logon Name or UPN (User
  31. Principal Name) formats. For example, EXAMPLE\\user and user@example.com
  32. respectively.
  33. If you use a Windows SSPI-enabled curl binary and perform Kerberos V5,
  34. Negotiate, NTLM or Digest authentication then you can tell curl to select
  35. the user name and password from your environment by specifying a single colon
  36. with this option: "-u :".
  37. If this option is used several times, the last one will be used.