The Linux Server uploads files to S3 through the AWS command line

Source: Internet
Author: User
Tags awscli aws console aws regions

The Linux Server uploads files to S3 through the AWS command line

Purpose
The Linux Server uploads files to S3 through the AWS command line

Configuration
Open your AWS console;

Create a new user (such as test) in IAM. When it is created, it automatically creates a user security credential consisting of an "access key ID" and "Private access key, remember it and download the credential, which will be used later;

Select the user you just created and have an "Additional permission" under the "permission" tab. Click it, find a permission named "AmazonS3FullAccess" in the list, and check it, click "add permission ";

To connect to your Linux server, follow these steps.

# Installing pip
Yum-y install python-pip

# Installing awscli
Pip install awscli

# Initialization Configuration
Aws configure
# In this step, the system requires you to enter "access key ID", "Private access key", "Default region name", and "Default output format ", the first two are automatically generated when you create an IAM user. The "Default region name" is recommended to select the region where your EC2 instance is located. If you are not clear about the string corresponding to the region where your EC2 instance is located, refer to the link provided below. If you do not want to fill it out, it will automatically select the region closest to you. The "Default output format" can be in json or text format, the default format is json.

# Creating buckets
Aws s3 mb s3: // test20160307

# Upload a file to a bucket
Aws s3 cp/etc/my. cnf s3: // test20160307/

You can use the preceding steps to upload files to S3 through the AWS command line.
For more help information, see the AWS Official Website: http://docs.aws.amazon.com/zh_cn/cli/latest/userguide/cli-chap-welcome.html
For more information about AWS regions, see AWS Official Website: http://docs.aws.amazon.com/zh_cn/general/latest/gr/rande.html

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.