简体   繁体   English

如何使用 AWS 上的密钥对访问 SFTP 服务器上的客户端以进行 s3 存储桶访问?

[英]How to give access to the Client on SFTP server for s3 bucket accessing using key pair on AWS?

我们想通过基于公钥认证的AWS SFTP服务器来访问客户端访问AWS上的s3存储桶,如何基于公钥认证访问客户端,我们将遵循哪些步骤?

If you are using AWS Transfer for SFTP , then you should:如果您使用AWS Transfer for SFTP ,那么您应该:

  • Ask the user to generate an RSA keypair and provide you with the public key要求用户生成 RSA 密钥对并向您提供公钥
  • Create a user in the AWS Transfer server and attach the public key在 AWS Transfer 服务器中创建一个用户并附加公有密钥

The user should then be able to connect to the server by using their private key.然后用户应该能够使用他们的私钥连接到服务器。

I think you'll also need to create an IAM Role that grants the user access to the appropriate S3 bucket.我认为您还需要创建一个 IAM 角色,授予用户访问相应 S3 存储桶的权限。 See: Working with service-managed users - AWS Transfer Family请参阅: 与服务托管用户合作 - AWS Transfer 系列

I created the key pair using ssh-keygen, then these two keys are store in same folder.我使用 ssh-keygen 创建了密钥对,然后这两个密钥存储在同一个文件夹中。 following script is passed then file is automatically transferred to cliet folder传递以下脚本,然后文件会自动传输到 cliet 文件夹

echo " Privatekey,PublicKey (copied)"
               
           chmod 600 $folder/id_rsa
# private key permission changed    
           filechmod_result=`echo $?`
        if [[ $filechmod_result -eq  0 ]];
                then
                     echo "chmod is success 12345678"
                else
                 echo "chmod is fail"
                 fi 
             
 sftp -o Port=8022 -o IdentityFile=$folder/id_rsa -o StrictHostKeyChecking=no $username@$servername << !
            cd client folder
            put $folder/$client folder
            ls

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

相关问题 如何授予我的 aws sftp 服务器访问另一个 AWS 账户中的 Amazon S3 存储桶的权限? - How can I grant my aws sftp server access to an Amazon S3 bucket in another AWS account? 如何使用 aws lambda 将文件从 aws sftp 服务器复制到 s3 存储桶 - how to copy file from aws sftp server to s3 bucket using aws lambda 访问客户端的 AWS S3 存储桶 - Access client's AWS S3 bucket AWS REST Api 作为 S3 代理并访问客户端特定的存储桶 - AWS REST Api as S3 proxy and accessing client specific bucket 如何访问AWS S3存储桶 - How to get access to AWS S3 bucket 如何在 NodeJS 中将文件从 S3 存储桶上传到服务器(SFTP)? - How to upload file from S3 bucket to server (SFTP) in NodeJS? 使用密钥访问 S3 Bucket - Access S3 Bucket by using key 在不使用访问密钥的情况下上传 AWS S3 存储桶中的文件,仅使用 KMS 密钥 - Uploading files in AWS S3 bucket without using Access key, using KMS Key only 如何将驻留在账户 A 中的 s3 存储桶的访问权限授予来自多个 aws 账户的不同 iam 用户? - How to give access of s3 bucket residing in Account A to different iam users from multiple aws accounts? 如何授予外部AWS IAM用户访问特定S3存储桶文件夹的权限 - How to give external AWS IAM user access to specific S3 Bucket folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM