Installation and configuration S3CMD Centos

At work and home (for my nopnop.nl site) I needed a waynto backup a server (mysql / mongodb and files). I could just zip it and ftp itnto my Synology at home… but…. why not save the cloud server files on anotherncloud like AWS Amazon!

So I found the S3CMD tools for connecting to mynAWS Bucket.n< !–more –>nInstallation was not very easy. Which means that “yum install s3cmd” on CENTOSnjust did not work. So I searched the internet for the solution and created ancomplete installation with python 2.7 and configuration.

S3CMD Installation

This will mostly likely work on any older distro where s3cmd is stuck atn1.0.x. What you need is the multipart upload support that is in version 1.1.xnand greater. The strategy for CentOS 5.x is that you don’t want to break thenPython 2.4 base install as admin features within CentOS 5.x rely on it.nTherefore, we want to create a self contained Python 2.7 installation.

1. Remove s3cmd package

yum remove s3cmd

  1. Install at least Python 2.7.

IMPORTANT: MAKE SURE TO USE “make altinstall” in the last step


tar xf Python-2.7.3.tar.bz2

cd Python-2.7.3 ./configure --prefix=/usr/local

make && make altinstall
  1. Download and compile latest s3cmd against Python 2.7
wget -O v1.5.0-alpha3.tar.gz &lt;https://github.com/s3tools/s3cmd/archive/v1.5.0-alpha3.tar.gz>

tar xvzf v1.5.0-alpha3.tar.gz

cd s3cmd-1.5.0-alpha3/

python2.7 setup.py install
  1. Reload shell and test
exec bash

s3cmd --version

Outcome :

s3cmd version 1.5.0-alpha3

  1. Configure s3cmd

In order to configure s3cmd we would required Access Key and Secret Key of your S3 Amazon account. Get these security keys from aws securityCredentials page. If will prompt to login to your amazon account.

After getting key files, use below command to configure s3cmd.

s3cmd --configure

Will result in:

Fill in the Credentials as known for your server on Amazon.

Key Id: [KEY ID]

Secret Access Key: [SECRET ACCESS KEY]

Password: [PASSWORD]

Path to GPG program [/usr/bin/gpg]: [ENTER]

Use HTTPS protocol [No]: No (no encryption needed as files are already encrypted)

HTTP Proxy server name: [ENTER]

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

Outcome:

Please wait, attempting to list all buckets...

Please wait...

Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...

Success. Encryption and decryption worked fine :-)

Or !! Outcome:

Please wait, attempting to list all buckets...

WARNING: Retrying failed request: /?delimiter=/ ([Errno 32] Broken pipe)

WARNING: Waiting 3 sec...

Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...

Success. Encryption and decryption worked fine :-) nSave settings? [y/N] Y

All done! nNow you can connect easily to your own amazon bucket! nWith special thanks to these sites : minimul.com and tecadmin.net```

Did you find this article valuable?

Support Theo van der Sluijs Blog by becoming a sponsor. Any amount is appreciated!