Objective
Linux server uploads files to S3 via AWS Command line
Configuration
Open your AWS console;
To connect to your Linux server, follow the steps below:
# install PIP
Yum-y Install Python-pip
# Install AWSCLI
Pip Install Awscli
# Initialize Configuration
AWS Configure
# This step will require you to enter "access key ID", "Private access Key", "Default zone Name", "Default output format", the first two will be generated automatically when IAM user is created, "Default zone name" is best to choose the area where you EC2, If you do not know your EC2 area corresponding to the string is what, you can refer to the link I provided below, if you really do not want to fill out the problem, it will automatically select the area closest to you, "default output format" can be filled in JSON and text format, the default is JSON format.
AWS Access Key ID [None]: XXX
AWS Secret Access Key [None]: XXX
Default region name [none]:xxx
Efault output format [None]: Default
# Create Buckets
AWS S3 MB S3://test
# Upload files to a bucket
AWS S3 CP/ETC/MY.CNF S3://test/
The above steps will complete the purpose of uploading files to S3 through the AWS command line.
Linux server uploads files to S3 via AWS Command line