echo -n beep:boop | base64
YmVlcDpib29w
Note: it's important to use
-n
otherwiseecho
will add a line break and that can be a time consuming error to debug when you find your username/password isn't working ;-) if you do find you need to debug, then usecurl
with the-v
flag and inspect the request headers being sent and make sure your base64 encoded username/password matches what curl generates for theAuthorization
header when using the--user
flag (see below curl examples)