对 Amazon S3 存储桶的 FTP/SFTP 访问 [英] FTP/SFTP access to an Amazon S3 Bucket
问题描述
有没有办法通过 FTP 或 SFTP 而不是 AWS 控制台中的内置 Amazon 文件传输接口连接到 Amazon S3 存储桶?这不是一个现成的选项似乎很奇怪.
Is there a way to connect to an Amazon S3 bucket with FTP or SFTP rather than the built-in Amazon file transfer interface in the AWS console? Seems odd that this isn't a readily available option.
推荐答案
共有三个选项.
- 您可以使用亚马逊最近添加的本机托管 SFTP 服务(更容易设置).
- 或者,您可以将存储桶挂载到 Linux 服务器上的文件系统,并使用 SFTP 访问这些文件,就像服务器上的任何其他文件一样(这让您有更大的控制权).
- 或者,您也可以使用原生支持 S3 协议(免费的)的 (GUI) 客户端.
在您的 Amazon AWS 控制台中,转到 AWS Transfer for SFTP 并创建一个新服务器.
In your Amazon AWS Console, go to AWS Transfer for SFTP and create a new server.
在 SFTP 服务器页面中,添加一个新的 SFTP 用户(或多个用户).
In SFTP server page, add a new SFTP user (or users).
用户的权限由 IAM 服务中的关联 AWS 角色管理(为了快速入门,您可以使用 AmazonS3FullAccess 策略).
该角色必须与 transfer.amazonaws.com
具有信任关系.
The role must have a trust relationship to transfer.amazonaws.com
.
有关详细信息,请参阅我的指南设置对 Amazon S3 的 SFTP 访问.
For details, see my guide Setting up an SFTP access to Amazon S3.
只需使用 s3fs
文件系统(或类似文件系统)将存储桶挂载到 Linux 服务器(例如 Amazon EC2)并使用服务器的内置 SFTP 服务器访问存储桶.
Just mount the bucket using s3fs
file system (or similar) to a Linux server (e.g. Amazon EC2) and use the server's built-in SFTP server to access the bucket.
- 安装
s3fs
- 将您的安全凭证以
access-key-id:secret-access-key
形式添加到/etc/passwd-s3fs
向
fstab
添加一个bucket挂载入口:
- Install the
s3fs
- Add your security credentials in a form
access-key-id:secret-access-key
to/etc/passwd-s3fs
Add a bucket mounting entry to
fstab
:
<bucket> /mnt/<bucket> fuse.s3fs rw,nosuid,nodev,allow_other 0 0
有关详细信息,请参阅我的指南设置对 Amazon S3 的 SFTP 访问.
For details, see my guide Setting up an SFTP access to Amazon S3.
或者使用任何免费的FTP/SFTP 客户端",这也是一个S3 客户端",并且您无需在服务器端进行任何设置.例如,my WinSCP 或 网络鸭.
Or use any free "FTP/SFTP client", that's also an "S3 client", and you do not have setup anything on server-side. For example, my WinSCP or Cyberduck.
WinSCP 甚至还有 脚本 和 .NET/PowerShell 接口,如果您需要自动传输.
WinSCP has even scripting and .NET/PowerShell interface, if you need to automate the transfers.
这篇关于对 Amazon S3 存储桶的 FTP/SFTP 访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!