[英]How to upload local system files in my Linux server to Amazon S3 Bucket using ssh?
I am trying to upload a file which I have on my Linux server onto my AWS S3 bucket.我正在尝试将我在 Linux 服务器上的文件上传到我的 AWS S3 存储桶中。 Can anyone please advise on how to do so as I only find documentations which is related to upload the files to EC2 instead.
任何人都可以建议如何这样做,因为我只找到与将文件上传到 EC2 相关的文档。
I do have the.pem certificate present on my server directory.我的服务器目录中确实有 .pem 证书。
I tried to run the following command but it doesn't solve the issue我尝试运行以下命令,但没有解决问题
scp -i My_PEM_FILE.pem "MY_FILE_TO_BE_UPLOADED.txt" MY_USER@S3-INSTANCE.IP.ADDRESS.0.compute.amazonaws.com
It is not possible to upload to Amazon S3 by using SSH.无法使用 SSH 上传到 Amazon S3。
The easiest way to upload from anywhere to an Amazon S3 bucket is to use the AWS Command-Line Interface (CLI) :从任何地方上传到 Amazon S3 存储桶的最简单方法是使用AWS 命令行界面 (CLI) :
aws s3 cp MY_FILE_TO_BE_UPLOADED.txt s3://my-bucket/
This will require an Access Key and a Secret Key to be stored via the aws configure
command.这将需要通过
aws configure
命令存储一个访问密钥和一个秘密密钥。 You can obtain these keys from your IAM User in the IAM management console (Security Credentials tab).您可以在 IAM 管理控制台(安全凭证选项卡)中从您的 IAM 用户处获取这些密钥。
See: aws s3 cp — AWS CLI Command Reference请参阅: aws s3 cp — AWS CLI 命令参考
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.