How to Pass Username and Password in cURL Commands Safely?

7 Replies, 1704 Views

Honestly, I’d avoid using `--user` in scripts unless you’re absolutely sure the script is secure. Even then, it’s risky. I’d go with environment variables or `.netrc` like others mentioned.

If you’re on Linux, you can also use `gpg` to encrypt your credentials and decrypt them on the fly in your script. It’s a bit more work, but way safer for curl username password handling.

Messages In This Thread



Users browsing this thread: 1 Guest(s)