s3cmd is not prompting me for an S3 Endpoint. How can I get s3cmd to work with Object Storage?

Linode Staff

When I run s3cmd --configure, I'm not prompted for the Linode Object Storage endpoint. This is causing my access key to fail because s3cmd thinks it belongs to a different provider. How can I fix this?

2 Replies

When you run s3cmd --configure, you should be receiving a prompt for S3 Endpoint as shown in our Object Storage guide. However, this feature was added via this GitHub PR in 2016, so not all versions of s3cmd will prompt for S3 Endpoint when using the --configure flag.

I tested this command on my own Linode running Debian 9, and the version that was installed when I ran apt-get install s3cmd is an older version of s3cmd. You can check your s3cmd version by running s3cmd --version. The one installed via apt was 1.6.1; I was not able to locate a more up-to-date version using apt-cache search.

Since s3cmd --configure isn't prompting you to change the endpoint, you'll need to do so manually in your .s3cfg file. This is most likely located in /home/$user/.s3cfg if you're running a Linux-based system. There are three values you'll need to update; I've listed them below using us-east-1.linodeobjects.com:

host_base = us-east-1.linodeobjects.com
host_bucket = %(bucket)s.us-east-1.linodeobjects.com
website_endpoint = http://%(bucket)s.website-us-east-1.linodeobjects.com/

I made these changes in my own .s3cfg file and was able to list my buckets afterwards using s3cmd ls. If you plan to create buckets in Frankfurt, you'll need to use eu-central-1 instead.

I am unsure of how common this issue is, but I dealt with something similar today (Early August 2021) on s3cmd version 2.1.0. I followed along with the config prompts from s3cmd and this guide from Linode on configuring s3cmd for Linode Object Storage. Upon attempting to test the supplied configuration I got the following error:

Test access with supplied credentials? [Y/n] 
Please wait, attempting to list all buckets...
ERROR: Test failed: 403 (SignatureDoesNotMatch)

I quit out and didn't save the config a few times. After seeing this I decided to go ahead and save it to see what had been written to the config at: /Users/me/.s3cfg. I took a look and everything seemed correct so I gave the tool a shot and it just worked.

❯ s3cmd ls                                                   
2021-08-06 17:12  s3://best-bucket-name-ever

Reply

Please enter an answer
Tips:

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] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct