Amazon IAM user creation for single S3 bucket access

Login to AWS Management Console and from there select IAM:

1

From the IAM Console, click on the “Create new users” button in the toolbar, enter the name of the new user(You can give it any name like I gave it mymysqlbktos3) and then click “Create” button on the bottom of that form:

2

It will present you with the message “Your 1 User(s) has been created successfully“, Click “Download Credentials” button on the bottom to download the Security Credentials for that user, after that close the message box :

3

Select the new user and switch to the “Permissions” tab on the bottom, then click “Attach User Policy” button on that tab:

4

Select the “Custom Policy” and press “Select“:

5

Enter the Policy Name (Whatever you want, like I have entered the mysqlbktos3-policy) and Paste the following text as the Policy Document (Please change the Bucket Name, on which you want to give access to the following user, in my case the bucket name is mymysqlbk) and click “Apply Policy“:

{
 "Statement": [
 {
 "Effect": "Allow",
 "Action": ["s3:GetBucketLocation", "s3:ListAllMyBuckets"],
 "Resource": "arn:aws:s3:::*"
 },
 {
 "Effect": "Allow",
 "Action": ["s3:ListBucket" ],
 "Resource": [ "arn:aws:s3:::mymysqlbk"]
 },
 {
 "Effect": "Allow",
 "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject"],
 "Resource": [ "arn:aws:s3:::mymysqlbk/*"]
 }
 ]
}

6

Hope this will help you!

How to Install the latest version of s3cmd tool on Linux

Please install the required packages before installing the s3cmd tool and download the source zip from github:

sudo yum install unzip python-pip
wget https://github.com/s3tools/s3cmd/archive/master.zip

7

Unzip the downloaded source zip file and move to the unzipped directory:

unzip master.zip
cd s3cmd-master/

8

Once you have moved to the unzipped directory then just run this command:

sudo python setup.py install

9

Install the dateutil module, which is powerful extensions to the datetime module that is available in the Python standard library:

sudo pip install python-dateutil

10

Check the installed version of s3cmd tool:

s3cmd --version

s3cmd version

After installation, run the following command in order to configure the s3cmd tools using your AMAZON ACCESS KEY and SECRET KEY.

s3cmd --configure

11

Enjoy