Skip to content

Instantly share code, notes, and snippets.

@brainsik
Created March 15, 2021 16:48
Show Gist options
  • Save brainsik/03329c70a90eb57bbd9135252d10c2a7 to your computer and use it in GitHub Desktop.
Save brainsik/03329c70a90eb57bbd9135252d10c2a7 to your computer and use it in GitHub Desktop.
Upload a file to B2 Cloud Storage using SSE-C (customer managed key)

Generate key

dd if=/dev/random of=keyfile count=1 bs=32

Upload file

Endpoint is found in the bucket details via console.

aws --profile=b2 s3 \
  cp <src> s3://<bucket>/ \
  --sse-c=AES256 --sse-c-key=fileb://keyfile \
  --endpoint-url=https://s3.us-west-001.backblazeb2.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment