Bobcares

How to Configure s3cmd?

by | Oct 6, 2021

If we configure s3cmd we can store and serve large amounts of data.

Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.

Today, let us see how our techs configure the same.

 

Configure s3cmd

Spaces CDN minimizes page load times, improves performance, and reduces bandwidth and infrastructure costs.

Moving ahead, let us see the steps our Support Techs employ for its configuration.

  • Initialize the Configuration File

By default, when a user runs the configuration command, s3cmd stores its configuration file, .s3cfg, in the home directory of that user.

In case we only have a single provider and don’t want to specify its configuration file every time we use s3cmd, we configure the default ~/.s3cfg file:

s3cmd --configure

On the other hand, if we use s3cmd with another service, we can create an alternate configuration file.

To do so, we need to add the -c flag and supply a filename.

  • Enter Access Keys

When we run the script, it asks for an Access Key and Secret Key.

If we don’t have them, we can generate a set for s3cmd from the control panel’s API page.

Once we enter the keys, we have to accept the US for the Default Region.

We can also use the environment variables AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY to store a set of keys.

Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.
Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key []: EXAMPLE7UQOTHDTF3GK4
Secret Key []: exampleb8e1ec97b97bff326955375c5
  • Enter the Endpoint

Next, we need to enter the endpoint. We use the endpoint for the region the Spaces are in.

Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3.
S3 Endpoint [s3.amazonaws.com]: nyc3.bobspaces.com

Then, we will get a prompt that asks for a URL template to access the bucket.

Since Spaces supports DNS-based endpoint URLs, we can use the variable %(bucket)s to stand in for the name of the space.

Eventually, we enter the following template format. However, make note that we change this if the Space is in a different region.

Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used if the target S3 system supports dns based buckets.
DNS-style bucket+hostname:port template for accessing a bucket []: %(bucket)s.nyc3.bobspaces.com
  • Set an Encryption Password

If necessary, we can opt for an encryption password.

A password won’t cause objects to automatically encrypt; it just makes encryption available later.

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password:
  • Connect via HTTPS

Our next prompt will ask to use the HTTPS protocol. HTTPS protects data from being read while it’s in transit.

We just need to press ENTER to accept the default.

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP, and can only be proxied with Python 2.7 or newer
Use HTTPS protocol [Yes]: Yes
  • Set a Proxy Server

The final prompt is for an HTTP proxy server. This is optional.

If necessary, we enter the network’s IP address or domain name without the protocol.

Otherwise, we can press ENTER to leave it blank.

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't connect to S3 directly
HTTP Proxy server name:
  • Confirm, Test, and Save Settings

Once complete, the configuration script will provide a summary of the values it will use, followed by an opportunity to test them:

New settings:
Access Key: EXAMPLES7UQOTHDTF3GK4
Secret Key: b8e1ec97b97bff326955375c5example
Default Region: US
S3 Endpoint: nyc3.digitaloceanspaces.com
DNS-style bucket+hostname:port template for accessing a bucket: %(bucket)s.n
yc3.digitaloceanspaces.com
Encryption password: secure_password
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: True
HTTP Proxy server name:
HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] Y

As soon as the test completes successfully, we can enter Y to save the settings:

Please wait, attempting to list all buckets...
Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...
Success. Encryption and decryption worked fine :-)

Save settings? [y/N] Y

If the test fails or if we choose N, we have the opportunity to retry the configuration.

Once we save the configuration, we’ll receive confirmation of its location:

Configuration saved to '/home/sammy/nyc3'

[Need help with the procedure? We’d be glad to assist you]

 

Conclusion

In short, we saw how our Support Techs go about the configuration of s3cmd.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF