简体   繁体   English

如何使用 ssh 将我的 Linux 服务器中的本地系统文件上传到 Amazon S3 Bucket?

[英]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.

相关问题 如何使用 postdata preSigned Url 调用 Amazon S3 存储桶以使用空手道上传文件 - How to call Amazon S3 bucket using postdata preSigned Url to upload a file using Karate 如何从 amazon s3 存储桶中删除文件? - how to delete files from amazon s3 bucket? Terraform 和 S3 - 如何将文件上传到现有存储桶 - Terraform and S3 - How to upload files to an existing bucket 如何使用 cURL 从 Amazon S3 存储桶中删除文件 - How to delete a file from amazon S3 bucket using cURL 需要在 Ubuntu 22.04 上使用 AWS CLI 将所有文件从特定本地目录上传/复制到 AWS S3 存储桶 - Need to upload/copy ALL files from specific local directory to AWS S3 bucket using AWS CLI on Ubuntu 22.04 Rails Active Storage - 如何将本地文件迁移到 s3 存储桶 - Rails Active Storage - How to migrate local files to s3 bucket 如何使用“BatchPutDocument”服务将文件上传到 S3 存储桶? - How to upload a file to S3 bucket using "BatchPutDocument" service? 使用 Java (Amazon S3) 将 all.txt 文件从一个 object 复制到另一个但在同一个存储桶中 - Copy all .txt files from one object to another but in the same bucket using Java (Amazon S3) 将 FTP 个文件 (csv) 自动化到 Amazon S3 存储桶 - Automate FTP of files (csv) to Amazon S3 bucket 如何使用 python 列出 S3 存储桶文件夹中的文件 - how to list files from a S3 bucket folder using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM