【发布时间】:2021-12-23 22:26:46
【问题描述】:
我想使用这个工具在本地挂载一个 S3 目录。自述文件说:
s3fs 支持存储在 ${HOME}/.aws/credentials 中的标准 AWS 凭证文件。或者,s3fs 支持自定义 passwd 文件。
随后的示例似乎都使用了自定义 passwd 文件,而不是 ~/.aws 中的凭据。我想在~/.aws 中使用凭据。
我的 .aws 凭据和配置文件如下所示:
~/.aws/credentials:
[work]
aws_access_key_id=123abc
aws_secret_access_key=mykeyhere
aws_s3_endpoint=s3.us-south.cloud-object-storage.appdomain.cloud
~/.aws/config:
[work]
region=us-south
我第一次尝试“hello world”/运行 s3fs。提供自述文件示例:
使用现有存储桶 mybucket 和目录 /path/to/mountpoint 运行 s3fs:
s3fs mybucket /path/to/mountpoint -o passwd_file=${HOME}/.passwd-s3fs
我没有 passwd 文件,我想改用 .aws 中的凭据,但不知道该怎么做。试过了:
只是放弃-o passwd 选项并希望它会默认:
s3fs companyname-us-south-analytics-ml-models /home/doug/Documents/Projects/companyname/Projects/companynameS3
s3fs: could not determine how to establish security credentials.
然后我尝试按照示例添加 aws 凭据文件:
s3fs companyname-us-south-analytics-ml-models /home/doug/Documents/Projects/companyname/Projects/companynameS3 -o passwd_file=${HOME}/.aws/credentials
s3fs: could not determine how to establish security credentials.
然后,我尝试根据我的 aws 配置文件引用“工作”(在这里抓紧分支)
s3fs companyname-us-south-analytics-ml-models /home/doug/Documents/Projects/companyname/Projects/companynameS3 -o work
s3fs: could not determine how to establish security credentials.
我查看了man s3fs,发现一些正在认证的信息:
AUTHENTICATION
The s3fs password file has this format (use this format if you have only one set of creden‐
tials):
accessKeyId:secretAccessKey
If you have more than one set of credentials, this syntax is also recognized:
bucketName:accessKeyId:secretAccessKey
Password files can be stored in two locations:
/etc/passwd-s3fs [0640]
$HOME/.passwd-s3fs [0600]
我在使用~/.aws 中的设置进行身份验证时找不到任何内容。
如何使用 .aws 中的凭据设置 s3fs?
【问题讨论】: