How to Presign an S3 URL in AWS Using AWS CLI

You can use the AWS CLI to presign URLs so that objects in S3 can be shared publicly even if they are set as private.

Presigned URLs are great for sharing private files in an S3 bucket

aws s3 presign s3://<bucket>/<file.jpg>

This can also be coupled with an expiry duration:

aws s3 presign s3://<bucket>/<file.jpg> --expires-in 3600