user.d 1.8 KB

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