Jesse Lawson

Software engineering, artificial intelligence, writing, and open-source tools

Jan 1, 0001 - Server Admin Tutorials

How to Install s3cmd on Ubuntu

We use s3cmd to communicate with our backup servers and some of our development environments. Setting it up couldn’t be easier.

There are three steps involved here:

  1. Install s3cmd
  2. Get your AWS security credentials
  3. Configure s3cmd

Let’s get started!

Install s3cmd

Go to a command line environment and use apt-get to install it (or some other thing like yum):

sudo apt-get install s3cmd

Done!

Get your AWS security credentials

You’ll need to have an Access Key and a Secret Key to configure s3cmd in the next step, and to get that, you’ll go to your AWS Security Credentials page.

You’ll have to log in to your Amazon AWS account (duh), and from there, you can get your keys.

Configure s3cmd

Now comes the only hard part here — and it’s not even that hard!

Go to your command line and type in the following command:

s3cmd --configure

You’ll get a bunch of text on the screen which basically asks you for a bunch of information. Enter it in exactly as shown below (and enter your AWS access and secret keys where appropriate):

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
Access Key: **xxxxxxxxxxxxxxxxxxxxxx**
Secret Key: **xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx**

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: **[make up a password here; you don't have to remember it]**
Path to GPG program [/usr/bin/gpg]: **[Hit enter]**

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't be used if you're behind a proxy
Use HTTPS protocol [No]: **Yes**

New settings:
  Access Key: xxxxxxxxxxxxxxxxxxxxxx
  Secret Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  Encryption password: xxxxxxxxxx
  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**
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**
Configuration saved to '/root/.s3cfg'

And that’s it!

Check out some of my other tutorials on how to use this, or just jump right in and get started with the documentation yourself.