brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: curl -u with only a username prompts for the password

Curl
~/tips/tip-curl-user-prompt-password

curl -u alice https://example.com/private/

Makes curl ask for the password so it never appears in history or the process list.

A password typed into the command line ends up in shell history and in the process list.

curl -u alice https://example.com/private/

With -u alice curl asks for the password without echoing it. -u alice:secret is visible to every user through ps while the command runs and stays in the history file. For scripts, put the login in ~/.netrc, with permissions 600, and use --netrc or -n. Basic authentication only encodes the password in base64, so use it over HTTPS.

Further reading: curl manual

More Curl tips curl --trace-ascii – https://example.com/ Retry-After: 120 curl -fsS --fail-early \ url = "https://example.com/data/latest.json" curl -4 -s -o /dev/null -w '%{remote_ip} %{http_code}\n' https://example.com/ All Curl tips (71) All topics

Link