How do I used s3cmd unattended?

I need to push a file up to Linode object storage using s3cmd (if there's an alternative app, please let me know). This will be done via a shell script, and must be 100% unattended, so I cannot manually create an auth session and enter my key/secret etc. All credentials and access parameters must be supplied as command line args.

I'm trying

s3cmd sync test.txt s3://

I've also tried using

s3cmd … --access_key=ACCESS_KEY --secret_key=SECRET_KEY

I get

ERROR: S3 error: 403 (InvalidAccessKeyId): The AWS Access Key Id you provided does not exist in our records.

I assume s3cmd is trying to authenticate up against AWS?

4 Replies

Did you set the website_endpoint in your .s3cfg?
It should look something like

website_endpoint = http://%(bucket)

This is mentioned in the guide on hosting a static site

No, I cannot set anything up on the system beforehand. All I can do is install s3cmd, there is no .s3cfg on my system and never will be, it's completely stateless. I can push to AWS with the example I'm using, I would like to be able to do the same with Linode.

Looks like the option you need (from the s3cmd docs) is



s3cmd … --access_key=ACCESS_KEY --secret_key=SECRET_KEY

You might also need to pass “--host-bucket=” to get correct URLs.

Thanks Andysh, that did it.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct