Site5 - Built For Designers & Developers MENU
Home  ›  Shell Access (SSH)  ›  SSH: Setup and configure the s3cmd tool for Amazon S3

SSH: Setup and configure the s3cmd tool for Amazon S3

Comments Off on SSH: Setup and configure the s3cmd tool for Amazon S3

In this article, we will show you how to setup and configure the s3cmd tool for Amazon S3.

For this article, you will need SSH access to your account.

  • 1) Login to your account using your preferred SSH client.
  • 2) Lets make a folder so we can download all the files we need.
mkdir s3downloads

Now lets move into this new folder…

cd s3downloads
  • 3) Now we need to download the Amazon s3cmd tool.
wget http://sourceforge.net/projects/s3tools/files/s3cmd/1.0.0/s3cmd-1.0.0.zip
  • 4) Lets unzip it and move into the folder.
unzip s3*zip
cd s3*
  • 5) Now its time to install it.
python2.6 setup.py install --user
  • 5) We need to move the file into a better folder, so lets do that now.
mkdir ~/bin
cp s3cmd ~/bin
cp -R S3 ~/bin
  • 6) Lets do some cleanup real fast.
cd
rm -r s3downloads
  • 7) Lets edit our bashrc file so it knows we have installed the s3cmd tool
nano ~/.bashrc

and add the following to the end…

if [ -d "$HOME/bin" ]; then
PATH="$HOME/bin:$PATH"
fi

  • 8) Now we need to source the bashrc file so the server knows we changed it.
source ~/.bashrc
  • 9) Now its time to configure the s3cmd tool. We can do this by running the following command.
s3cmd --configure
  • 9a) Enter your Amazon S3 Access Key
  • 9b) Enter your Secret Access Key
  • Note: Both of these can be found on the Security Credentials page at the following link: https://portal.aws.amazon.com
  • 9c) Now we need to enter a password (NOT the same one for amazon account ) that will be used to encrypt the local configuration files.
  • 9d) When asked for the path to gpg, just press enter.
  • 9e) If you would like to use HTTPs (recommended) type yes when prompted. Please note that you do NOT need a SSL certificate to use this https function.
  • 9f) Test the account by typing “y” (when prompted) then pressing enter.
  • 9g) If everything connected correctly, enter “y” when prompted to save the settings. If not, please re-try the configuration.
  • 10) That’s it! You now know how to install the Amazon s3cmd tools. Below we will show you some of the basic commands you can use with this tool.

 

Commands

  • mb
    • Command: s3cmd mb
    • Description: This command makes a new bucket.
    • Example: s3cmd mb s3://newbucket
  • rb
    • Command: s3cmd rb
    • Description: This command removes a bucket.
    • Example: s3cmd rb s3://buckettoremove
  • ls
    • Command: s3cmd ls
    • Description: This command lists all file. You can also tell it to check a path/bucket
    • Example: s3cmd ls
    • Example 2: s3cmd ls s3://buckettocheck
  • la
    • Command: s3cmd ls
    • Description: Lists all files in all buckets
  • put
    • Command: s3cmd put
    • Description: This command puts/uploads a file to the path your specify.
    • Example: s3cmd put ~/filetoupload.txt s3://buckettouploadto
  • get
    • Command: s3cmd get
    • Description: This is the same as the put command but in reverse.
    • Example: s3cmd get s3://bucket/filetodownload.txt ~/locationtoputit
  • del
    • Command: s3cmd del
    • Description: This command deltes a file on the S3 server.
    • Example: s3cmd del s3://bucket/filetodelete.txt

For more commands, please click here.

Still have a question? Or need help?
If you need technical support with your account, please email us or chat live with a representative.

Comments are closed.

Money Back Guarantees