简体   繁体   English

如何使用 python (boto3) 连接到带有 pem 文件的 Amazon S3 存储桶

[英]How do I connect to an Amazon S3 bucket with a pem file using python (boto3)

I got a bit lost in the boto3 API details and struggle to find an example to access an S3 bucket using python.我对 boto3 API 的详细信息有点迷失,并且很难找到使用 python 访问 S3 存储桶的示例。 I need to use an existing pem file rather than the typical access and secret key.我需要使用现有的 pem 文件而不是典型的访问和密钥。 Works fine using an ftp client but I need to get it running also with python.使用 ftp 客户端工作正常,但我还需要使用 python 运行它。

Anyone that can point me in the right direction (or suggest alternatives using python)任何可以为我指明正确方向的人(或使用 python 提出替代方案)

This is not possible.这不可能。

The types of authentication used on AWS are: AWS 上使用的身份验证类型有:

  • Username and password associated with an IAM User, used to login to the web management console.与 IAM 用户关联的用户名和密码,用于登录 Web 管理控制台。
  • Access Key and Secret Key associated with an IAM User, used to make API calls to AWS services与 IAM 用户关联的访问密钥和秘密密钥,用于对 AWS 服务进行 API 调用
  • Private Key (PPK/PEM) used to login to Linux instances.用于登录 Linux 实例的私钥 (PPK/PEM)

Private Keys are used to login to an operating system and are unrelated to AWS.私钥用于登录操作系统,与 AWS 无关。 They are a standard means of accessing Linux systems and identify users defined on the computer itself rather than on AWS.它们是访问 Linux 系统并识别在计算机本身而不是 AWS 上定义的用户的标准方法。

API calls to AWS require the Access Key and Secret Key and have no relationship to PPK/PEM keys.对 AWS 的 API 调用需要访问密钥和秘密密钥,并且与 PPK/PEM 密钥无关。

对于在 2020 年偶然发现这个问题的任何人,请参阅我关于将 boto3 和 Python 连接到 aws 的详细文章,其中有一个 S3 示例: https ://hocli.com/tech/getting-started-with-python-and -boto

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将文件从 databricks dbfs / local 上传到 S3 存储桶。 如何使用 boto3 库或挂载 s3 将文件从 databricks 上传到 S3 存储桶? - Uploading a file from databricks dbfs / local to an S3 bucket. How do i upload a file from databricks to S3 bucket using boto3 library or mounting s3? 如何使用 Boto3 下载 S3 存储桶的最新文件? - How to download the latest file of an S3 bucket using Boto3? 如何使用 Boto3 从 S3 将压缩的镶木地板文件读入 Python? - How do I read a gzipped parquet file from S3 into Python using Boto3? 如何在heroku上使用python中的boto3将文件上传到s3? - How do I upload a file to s3 using boto3 in python on heroku? 如何使用python boto3将文件上传到aws S3存储桶中的文件夹 - How to upload file to folder in aws S3 bucket using python boto3 如何使用 Python 和 Boto3 从 S3 Bucket 读取 Txt 文件 - How to read Txt file from S3 Bucket using Python And Boto3 Amazon S3 boto3 如何遍历存储桶中的对象? - Amazon S3 boto3 how to iterate through objects in a bucket? 我将如何使用 boto3 在 s3 存储桶上的 aws 文件上传成功响应? - How I will get response of success in aws file upload on s3 bucket using boto3? 使用boto3将文件上传到Amazon S3存储桶中的特定位置? - Uploading File to a specific location in Amazon S3 Bucket using boto3? 在 Python (Boto3) 中打开 S3 存储桶中的 .docx 文件 - Opening a .docx file in S3 bucket in Python (Boto3)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM